public class Range
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CIDR_DELIMITER |
static java.lang.String |
INVALID_RANGE_FORMAT |
static java.lang.String |
INVALID_RANGE_SPECIFIED |
static java.lang.String |
RANGE_DELIMITER |
static java.lang.String |
SUPPLIED_RANGE_IS_NULL |
Constructor and Description |
---|
Range(IPv4 ipMasked) |
Range(IPv4 startIp,
IPv4 lastIp) |
Range(IPv4 startIp,
IPv4 lastIp,
RangeDefinitionType rangeDefinitionType) |
Range(IPv4 startIp,
IPv4 lastIp,
RangeType type) |
Range(IPv4 startIp,
IPv4 lastIp,
RangeType type,
RangeDefinitionType rangeDefinitionType) |
Range(IPv4 ipMasked,
RangeDefinitionType rangeDefinitionType) |
Range(java.lang.String range) |
Range(java.lang.String range,
RangeDefinitionType rangeDefinitionType)
Range must be in the format of IP(low)-IP(high)
or CIDR-notation string, e.g.
|
Range(java.lang.String range,
RangeType type)
Range must be in the format of IP(low)-IP(high) or CIDR notation
|
Range(java.lang.String range,
RangeType type,
RangeDefinitionType rangeDefinitionType)
Range must be in the format of IP(low)-IP(high) or CIDR notation
|
Modifier and Type | Method and Description |
---|---|
Range |
createNewRangeWithSameAttributes(IPv4 startIp,
IPv4 lastIp) |
Range[] |
createRangeArray(int size) |
boolean |
equals(java.lang.Object o) |
java.util.List<java.lang.String> |
getAllIPs(int maxIPs)
Get list of IPs in range.
|
RangeDefinitionType |
getDefinitionType() |
IPv4 |
getFirstIp() |
IPv4 |
getLastIp() |
Range |
getOverlapRange(Range r) |
RangeType |
getRawType()
Gets the raw type of the ip range.
|
long |
getTotalIPs()
Get total IPs is range
|
RangeType |
getType()
Gets the type of the ip range.
|
int |
hashCode() |
void |
initRange(IPv4 firstIp,
IPv4 lastIp) |
boolean |
isEmptyRange() |
boolean |
isIpInRange(IPv4 ip) |
boolean |
isRangeOverlap(Range r) |
boolean |
isRangeValid()
Valid range definition:
1.
|
boolean |
isSubRangeOf(Range r) |
void |
setDefinitionType(RangeDefinitionType definitionType) |
void |
setType(RangeType type) |
Range[] |
splitRangeByExcludeRanges(Range[] excludeRanges)
Splits range with excluded ranges
|
static int[] |
splitRanges(int[] src) |
java.lang.String |
toRangeString() |
java.lang.String |
toRangeString(java.lang.String separator) |
java.lang.String |
toString() |
java.lang.String |
toStringByDefinition() |
public static java.lang.String INVALID_RANGE_SPECIFIED
public static java.lang.String INVALID_RANGE_FORMAT
public static java.lang.String SUPPLIED_RANGE_IS_NULL
public static final java.lang.String CIDR_DELIMITER
public static final java.lang.String RANGE_DELIMITER
public Range(IPv4 startIp, IPv4 lastIp, RangeDefinitionType rangeDefinitionType)
public Range(IPv4 startIp, IPv4 lastIp, RangeType type, RangeDefinitionType rangeDefinitionType)
public Range(IPv4 ipMasked, RangeDefinitionType rangeDefinitionType)
public Range(IPv4 ipMasked)
public Range(java.lang.String range)
public Range(java.lang.String range, RangeDefinitionType rangeDefinitionType)
range
- range string representationpublic Range(java.lang.String range, RangeType type)
range
- range string representationtype
- the type of the ip rangepublic Range(java.lang.String range, RangeType type, RangeDefinitionType rangeDefinitionType)
range
- range string representationtype
- the type of the ip rangepublic java.lang.String toRangeString()
public java.lang.String toRangeString(java.lang.String separator)
public java.lang.String toStringByDefinition()
public IPv4 getFirstIp()
public IPv4 getLastIp()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isIpInRange(IPv4 ip)
public boolean isRangeOverlap(Range r)
public boolean isSubRangeOf(Range r)
public Range[] splitRangeByExcludeRanges(Range[] excludeRanges)
excludeRanges
- excluded rangespublic Range createNewRangeWithSameAttributes(IPv4 startIp, IPv4 lastIp)
public Range[] createRangeArray(int size)
public boolean isRangeValid()
public boolean isEmptyRange()
public static int[] splitRanges(int[] src)
public long getTotalIPs()
public java.util.List<java.lang.String> getAllIPs(int maxIPs) throws java.lang.Exception
maxIPs
- - max allowed IP addresses in range, to fetchjava.lang.Exception
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public RangeType getType()
public RangeType getRawType()
public void setType(RangeType type)
public RangeDefinitionType getDefinitionType()
public void setDefinitionType(RangeDefinitionType definitionType)
Documentation Feedback
Copyright 2012 Micro Focus or one of its affiliates.