public class IPv4AddressSegment extends IPAddressSegment
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_CHARS |
ADJUST_RANGES_BY_PREFIX| Constructor and Description |
|---|
IPv4AddressSegment(int value)
Constructs a segment of an IPv4 address with the given value.
|
IPv4AddressSegment(int value,
java.lang.Integer segmentPrefixLength)
Constructs a segment of an IPv4 address.
|
IPv4AddressSegment(int lower,
int upper,
java.lang.Integer segmentPrefixLength)
Constructs a segment of an IPv4 address that represents a range of values.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(IPAddressSegment other) |
boolean |
equals(java.lang.Object other) |
int |
getBitCount() |
int |
getByteCount() |
int |
getDefaultMaxChars() |
int |
getDefaultTextualRadix() |
IPAddress.IPVersion |
getIPVersion() |
IPv4AddressSegment |
getLower()
If this segment represents a range of values, returns a segment representing just the lowest value in the range, otherwise returns this.
|
int |
getMaxSegmentValue() |
static IPv4AddressNetwork.IPv4AddressCreator |
getSegmentCreator() |
IPv4AddressSegment |
getUpper()
If this segment represents a range of values, returns a segment representing just the highest value in the range, otherwise returns this.
|
boolean |
isIPv4() |
java.util.Iterator<IPv4AddressSegment> |
iterator() |
IPv4AddressSegment |
toHostSegment(java.lang.Integer bits)
used by getHostSection, see
IPAddress.getHostSection(int) |
IPv4AddressSegment |
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.
|
IPv4AddressSegment |
toNetworkSegment(java.lang.Integer segmentPrefixLength)
used by constructors of IPAddressSection, see
IPAddress.getNetworkSection(int, boolean) |
IPv4AddressSegment |
toNetworkSegment(java.lang.Integer segmentPrefixLength,
boolean withPrefixLength)
used by getNetworkSection and by constructors of IPAddressSection, see
IPAddress.getNetworkSection(int, boolean) |
getBitCount, getByteCount, getCount, getDefaultTextualRadix, getLowerSegmentValue, getLowerValue, getMaxSegmentValue, getMaxValue, getMinPrefix, getSegmentPrefixLength, getUpperSegmentValue, getUpperValue, hashCode, isFullRange, isFullRange, isIPv6, isMaskCompatibleWithRange, isMaskCompatibleWithRange, isMultiple, matches, matchesWithMask, matchesWithPrefixcompareTo, defaultMaxCharsPerSegment, getCharWidth, getDefaultMaxChars, getDivisionPrefixLength, getMaskPrefixLength, getMaxLeadingZeros, getPrefixAdjustedWildcardString, getString, getWildcardString, getWildcardString, hasAlphabeticDigits, isFullRange, isMaskCompatibleWithRange, isPrefixed, isRangeEquivalent, isRangeEquivalentToPrefix, isRangeUnchanged, isSamePrefixedRange, isZero, matches, matchesWithMask, matchesWithPrefix, rangeIsWithin, toString, valueIsWithinpublic static final int MAX_CHARS
public IPv4AddressSegment(int value)
value - the value of the segmentpublic IPv4AddressSegment(int value,
java.lang.Integer segmentPrefixLength)
value - the value of the segment. If the segmentPrefixLength is non-null, the network prefix of the value is used, and the segment represents all segment values with the same network prefix.segmentPrefixLength - the segment prefix, which can be nullpublic IPv4AddressSegment(int lower,
int upper,
java.lang.Integer segmentPrefixLength)
segmentPrefixLength - the segment prefix length, which can be null. If segmentPrefixLength is non-null, this segment represents a range of segment values with the given network prefix length.lower - the lower value of the range of values represented by the segment. If segmentPrefixLength is non-null, the lower value becomes the smallest value with the same network prefix.upper - the upper value of the range of values represented by the segment. If segmentPrefixLength is non-null, the upper value becomes the largest value with the same network prefix.public boolean isIPv4()
isIPv4 in class IPAddressSegmentpublic IPAddress.IPVersion getIPVersion()
getIPVersion in class IPAddressSegmentpublic int getMaxSegmentValue()
getMaxSegmentValue in class IPAddressSegmentpublic IPv4AddressSegment toNetworkSegment(java.lang.Integer segmentPrefixLength)
IPAddressSegmentIPAddress.getNetworkSection(int, boolean)toNetworkSegment in class IPAddressSegmentpublic IPv4AddressSegment toNetworkSegment(java.lang.Integer segmentPrefixLength, boolean withPrefixLength)
IPAddressSegmentIPAddress.getNetworkSection(int, boolean)toNetworkSegment in class IPAddressSegmentpublic IPv4AddressSegment toHostSegment(java.lang.Integer bits)
IPAddressSegmentIPAddress.getHostSection(int)toHostSegment in class IPAddressSegmentpublic IPv4AddressSegment toMaskedSegment(IPAddressSegment maskSegment, java.lang.Integer segmentPrefixLength) throws IPAddressTypeException
IPAddressSegmentIPAddress.toSubnet(int),
IPAddress.toSubnet(IPAddress, Integer),
IPAddress.isMaskCompatibleWithRange(IPAddress, Integer)toMaskedSegment in class IPAddressSegmentIPAddressTypeExceptionpublic IPv4AddressSegment getLower()
IPAddressSegmentgetLower in class IPAddressSegmentpublic IPv4AddressSegment getUpper()
IPAddressSegmentgetUpper in class IPAddressSegmentpublic static IPv4AddressNetwork.IPv4AddressCreator getSegmentCreator()
public java.util.Iterator<IPv4AddressSegment> iterator()
iterator in class IPAddressSegmentpublic int getBitCount()
getBitCount in class IPAddressDivisionpublic int getByteCount()
getByteCount in class IPAddressDivisionpublic int getDefaultTextualRadix()
getDefaultTextualRadix in class IPAddressDivisionpublic int getDefaultMaxChars()
getDefaultMaxChars in class IPAddressDivisionpublic boolean contains(IPAddressSegment other)
contains in class IPAddressSegmentpublic boolean equals(java.lang.Object other)
equals in class java.lang.Object