public abstract class IPAddressSegment extends IPAddressDivision
ADJUST_RANGES_BY_PREFIX
Modifier and Type | Method and Description |
---|---|
boolean |
contains(IPAddressSegment other) |
static int |
getBitCount(IPAddress.IPVersion version) |
static int |
getByteCount(IPAddress.IPVersion version) |
long |
getCount() |
static int |
getDefaultTextualRadix(IPAddress.IPVersion version) |
abstract IPAddress.IPVersion |
getIPVersion() |
abstract IPAddressSegment |
getLower()
If this segment represents a range of values, returns a segment representing just the lowest value in the range, otherwise returns this.
|
int |
getLowerSegmentValue()
returns the lower value
|
long |
getLowerValue()
returns the lower value as a long, although for individual segments
getLowerSegmentValue() provides the same value as an int |
abstract int |
getMaxSegmentValue() |
static int |
getMaxSegmentValue(IPAddress.IPVersion version) |
long |
getMaxValue() |
int |
getMinPrefix() |
java.lang.Integer |
getSegmentPrefixLength() |
abstract IPAddressSegment |
getUpper()
If this segment represents a range of values, returns a segment representing just the highest value in the range, otherwise returns this.
|
int |
getUpperSegmentValue()
returns the upper value
|
long |
getUpperValue()
returns the lower upper value as a long, although for individual segments
getUpperSegmentValue() provides the same value as an int |
int |
hashCode() |
static boolean |
isFullRange(int lower,
int upper,
java.lang.Integer prefix,
IPAddress.IPVersion version) |
static boolean |
isFullRange(int lower,
int upper,
IPAddress.IPVersion version) |
boolean |
isIPv4() |
boolean |
isIPv6() |
boolean |
isMaskCompatibleWithRange(int maskValue,
java.lang.Integer segmentPrefix) |
boolean |
isMaskCompatibleWithRange(IPAddressSegment maskSegment,
java.lang.Integer segmentPrefixLength) |
boolean |
isMultiple() |
abstract java.util.Iterator<? extends IPAddressSegment> |
iterator() |
boolean |
matches(int value) |
boolean |
matchesWithMask(int value,
int mask) |
boolean |
matchesWithPrefix(int value,
java.lang.Integer segmentPrefixLength) |
abstract IPAddressSegment |
toHostSegment(java.lang.Integer segmentPrefixLength)
used by getHostSection, see
IPAddress.getHostSection(int) |
abstract IPAddressSegment |
toMaskedSegment(IPAddressSegment maskSegment,
java.lang.Integer segmentPrefixLength)
returns a new segment masked by the given mask
This method applies the mask first to every address in the range, and it does not preserve any existing prefix.
|
IPAddressSegment |
toNetworkSegment(java.lang.Integer segmentPrefixLength)
used by constructors of IPAddressSection, see
IPAddress.getNetworkSection(int, boolean) |
abstract IPAddressSegment |
toNetworkSegment(java.lang.Integer segmentPrefixLength,
boolean withPrefixLength)
used by getNetworkSection and by constructors of IPAddressSection, see
IPAddress.getNetworkSection(int, boolean) |
compareTo, defaultMaxCharsPerSegment, getBitCount, getByteCount, getCharWidth, getDefaultMaxChars, getDefaultMaxChars, getDefaultTextualRadix, getDivisionPrefixLength, getMaskPrefixLength, getMaxLeadingZeros, getPrefixAdjustedWildcardString, getString, getWildcardString, getWildcardString, hasAlphabeticDigits, isFullRange, isMaskCompatibleWithRange, isPrefixed, isRangeEquivalent, isRangeEquivalentToPrefix, isRangeUnchanged, isSamePrefixedRange, isZero, matches, matchesWithMask, matchesWithPrefix, rangeIsWithin, toString, valueIsWithin
public boolean isIPv4()
public boolean isIPv6()
public abstract IPAddress.IPVersion getIPVersion()
public int getMinPrefix()
public static int getMaxSegmentValue(IPAddress.IPVersion version)
public IPAddressSegment toNetworkSegment(java.lang.Integer segmentPrefixLength)
IPAddress.getNetworkSection(int, boolean)
public abstract IPAddressSegment toNetworkSegment(java.lang.Integer segmentPrefixLength, boolean withPrefixLength)
IPAddress.getNetworkSection(int, boolean)
public abstract IPAddressSegment toHostSegment(java.lang.Integer segmentPrefixLength)
IPAddress.getHostSection(int)
public abstract IPAddressSegment toMaskedSegment(IPAddressSegment maskSegment, java.lang.Integer segmentPrefixLength) throws IPAddressTypeException
IPAddress.toSubnet(int)
,
IPAddress.toSubnet(IPAddress, Integer)
,
IPAddress.isMaskCompatibleWithRange(IPAddress, Integer)
IPAddressTypeException
public boolean isMaskCompatibleWithRange(IPAddressSegment maskSegment, java.lang.Integer segmentPrefixLength)
public boolean isMaskCompatibleWithRange(int maskValue, java.lang.Integer segmentPrefix)
public abstract IPAddressSegment getLower()
public abstract IPAddressSegment getUpper()
public abstract java.util.Iterator<? extends IPAddressSegment> iterator()
public static int getBitCount(IPAddress.IPVersion version)
public static int getByteCount(IPAddress.IPVersion version)
public static int getDefaultTextualRadix(IPAddress.IPVersion version)
public boolean matches(int value)
public boolean matchesWithPrefix(int value, java.lang.Integer segmentPrefixLength)
public boolean matchesWithMask(int value, int mask)
public long getCount()
getCount
in class IPAddressDivision
public long getMaxValue()
public abstract int getMaxSegmentValue()
public boolean isMultiple()
isMultiple
in class IPAddressDivision
public int getLowerSegmentValue()
public int getUpperSegmentValue()
public long getLowerValue()
getLowerSegmentValue()
provides the same value as an intgetLowerValue
in class IPAddressDivision
public long getUpperValue()
getUpperSegmentValue()
provides the same value as an intgetUpperValue
in class IPAddressDivision
public java.lang.Integer getSegmentPrefixLength()
public int hashCode()
hashCode
in class java.lang.Object
public boolean contains(IPAddressSegment other)
other
- public static boolean isFullRange(int lower, int upper, java.lang.Integer prefix, IPAddress.IPVersion version)
public static boolean isFullRange(int lower, int upper, IPAddress.IPVersion version)