public abstract class IPAddressDivision extends AddressDivision implements IPAddressGenericDivision
May be associated with a prefix length, in which case that number of bits in the upper-most portion of the object represent a prefix.
AddressDivision.BitwiseOrResult, AddressDivision.MaskResult
EXTENDED_DIGITS
Modifier and Type | Method and Description |
---|---|
boolean |
containsPrefixBlock(int divisionPrefixLen)
Returns whether the values of this series contains the prefix block for the given prefix length.
|
boolean |
containsSinglePrefixBlock(int divisionPrefixLen)
Returns whether the division range matches exactly the block of values for the given prefix length.
|
Integer |
getBlockMaskPrefixLength(boolean network)
If this is equivalent to the mask for a CIDR prefix length block or subnet class, it returns the prefix length.
|
Integer |
getDivisionPrefixLength()
Returns the network prefix for the division.
|
int |
getLeadingBitCount(boolean network)
Returns the number of consecutive leading one or zero bits.
|
int |
getPrefixAdjustedRangeString(int segmentIndex,
AddressSegmentParams params,
StringBuilder appendable)
Produces a string to represent the segment of the form a-b where the value b has been adjusted for the prefix, anything beyond the prefix length being zero.
|
String |
getString()
Produces a normalized string to represent the segment.
|
int |
getTrailingBitCount(boolean network)
Returns the number of consecutive trailing one or zero bits.
|
String |
getWildcardString()
Produces a string to represent the segment, favouring wildcards and range characters over the network prefix to represent subnets.
|
boolean |
isPrefixBlock()
Returns whether the division range includes the block of values for its prefix length
|
boolean |
isPrefixed() |
boolean |
isSinglePrefixBlock()
Returns whether the division range matches the block of values for its prefix length
|
boolean |
matchesWithPrefixMask(long value,
Integer divisionPrefixLen) |
bitwiseOrRange, equals, getDigitCount, getDivisionValue, getMaxDigitCount, getMaxValue, getMinPrefixLengthForBlock, getPrefixLengthForSingleBlock, getUpperDivisionValue, getUpperValue, getValue, hashCode, hasUppercaseVariations, includesMax, includesZero, isBitwiseOrCompatibleWithRange, isBoundedBy, isMaskCompatibleWithRange, isMax, isMultiple, isZero, maskRange, matches, matchesWithMask, matchesWithMask
getBytes, getBytes, getBytes, getDigitCount, getDigitCount, getLowerStandardString, getStandardString, getUpperBytes, getUpperBytes, getUpperBytes, toString
isFullRange
compareTo, getBitCount, getBitsForCount, getBlockSize, getByteCount, getBytes, getBytes, getBytes, getCount, getMinPrefixLengthForBlock, getPrefixCount, getPrefixLengthForSingleBlock, getUpperBytes, getUpperBytes, getUpperBytes, getUpperValue, getValue, includesMax, includesZero, isMax, isMultiple, isZero
getBitCount
getDigitCount, getLowerStandardString, getMaxDigitCount, getStandardString, isBoundedBy
public boolean isPrefixed()
isPrefixed
in interface IPAddressGenericDivision
public Integer getDivisionPrefixLength()
getDivisionPrefixLength
in interface IPAddressStringDivision
public boolean matchesWithPrefixMask(long value, Integer divisionPrefixLen)
public Integer getBlockMaskPrefixLength(boolean network)
Also, keep in mind that the prefix length returned by this method is not equivalent to the prefix length used to construct this object. The prefix length used to construct indicates the network and host portion of this address. The prefix length returned here indicates the whether the value of this address can be used as a mask for the network and host of an address with that prefix length. Therefore the two values can be different values, or one can be null while the other is not.
This method applies only to the lower value of the range if this segment represents multiple values.
network
- whether to check for a network mask or a host maskIPAddressSection.getPrefixLengthForSingleBlock()
public int getTrailingBitCount(boolean network)
This method applies only to the lower value of the range if this segment represents multiple values.
network
- public int getLeadingBitCount(boolean network)
This method applies only to the lower value of the range if this segment represents multiple values.
network
- public boolean containsPrefixBlock(int divisionPrefixLen)
AddressItem
Use AddressItem.getMinPrefixLengthForBlock()
to determine the smallest prefix length for which this method returns true.
containsPrefixBlock
in interface AddressItem
public boolean isPrefixBlock()
IPAddressStringDivision
isPrefixBlock
in interface IPAddressStringDivision
public boolean containsSinglePrefixBlock(int divisionPrefixLen)
containsSinglePrefixBlock
in interface AddressItem
divisionPrefixLen
- public boolean isSinglePrefixBlock()
IPAddressStringDivision
isSinglePrefixBlock
in interface IPAddressStringDivision
public String getString()
public String getWildcardString()
public int getPrefixAdjustedRangeString(int segmentIndex, AddressSegmentParams params, StringBuilder appendable)
IPAddressStringDivision
getPrefixAdjustedRangeString
in interface IPAddressStringDivision