public abstract class AddressDivision extends AddressDivisionBase
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Two divisions are equal if they:
- they match type/version (ipv4, ipv6, mac, or a specific division class)
- match bit counts
- match values
Prefix lengths, for those divisions that have them, are ignored.
|
java.math.BigInteger |
getCount()
The count of possible distinct values for this AddressComponent.
|
int |
getDigitCount(int radix)
Returns the count of digits of the value, or if a range, the larger value in the range
|
long |
getDivisionPrefixCount(int divisionPrefixLength) |
abstract long |
getDivisionValue() |
long |
getDivisionValueCount() |
int |
getMaxDigitCount(int radix)
Returns the count of digits of the largest possible value
|
long |
getMaxValue() |
int |
getMinPrefixLengthForBlock()
Returns the smallest prefix length possible such that this item includes the block of all values for that prefix length.
|
java.math.BigInteger |
getPrefixCount(int divisionPrefixLength)
The count of the number of distinct values within the prefix part of the address item, the bits that appear within the prefix length.
|
java.lang.Integer |
getPrefixLengthForSingleBlock()
Returns a prefix length for which the range of this item matches the block of all values for that prefix length.
|
abstract long |
getUpperDivisionValue() |
java.math.BigInteger |
getUpperValue()
Returns the highest value represented by this address item, the highest value included in the range of values
|
java.math.BigInteger |
getValue()
Returns the lowest value represented by this address item, the lowest value included in the range of values
|
int |
hashCode() |
boolean |
hasUppercaseVariations(int radix,
boolean lowerOnly) |
boolean |
includesMax()
Returns whether this item includes the maximum possible value for the address type or version within its range
|
boolean |
includesZero()
Returns whether this item includes the value of zero within its range
|
boolean |
isBoundedBy(int value)
Returns true if the possible values of this division fall below the given value.
|
boolean |
isMax()
Returns whether this item matches the maximum possible value for the address type or version
|
boolean |
isMultiple()
Whether this represents multiple potential values (eg a prefixed address or a segment representing a range of values)
|
boolean |
isZero()
Returns whether this item matches the value of zero
|
boolean |
matches(long value) |
boolean |
matchesWithMask(long value,
long mask) |
boolean |
matchesWithMask(long lowerValue,
long upperValue,
long mask)
returns whether masking with the given mask results in a valid contiguous range for this segment,
and if it does, if it matches the range obtained when masking the given values with the same mask.
|
getBytes, getBytes, getBytes, getDigitCount, getLowerStandardString, getStandardString, getUpperBytes, getUpperBytes, getUpperBytes, toStringcompareTo, containsPrefixBlock, containsSinglePrefixBlock, getBitCount, getByteCount, isFullRange, testRange, testRangepublic boolean isMultiple()
AddressItempublic int getMinPrefixLengthForBlock()
AddressItem
If the entire range can be dictated this way, then this method returns the same value as AddressItem.getPrefixLengthForSingleBlock().
Otherwise, this method will return the minimal possible prefix that can be paired with this address, while AddressItem.getPrefixLengthForSingleBlock() will return null.
In cases where the final bit is constant so there is no such block, this returns the bit count.
public java.lang.Integer getPrefixLengthForSingleBlock()
AddressItem
If the range can be dictated this way, then this method returns the same value as AddressItem.getMinPrefixLengthForBlock().
If no such prefix length exists, returns null.
If this item represents a single value, this returns the bit count.
public long getMaxValue()
public boolean isZero()
AddressItempublic boolean includesZero()
AddressItempublic boolean isMax()
AddressItempublic boolean includesMax()
AddressItempublic abstract long getDivisionValue()
public abstract long getUpperDivisionValue()
public int hashCode()
hashCode in class AddressDivisionBasepublic java.math.BigInteger getValue()
AddressItempublic java.math.BigInteger getUpperValue()
AddressItempublic long getDivisionValueCount()
public java.math.BigInteger getPrefixCount(int divisionPrefixLength)
AddressItempublic long getDivisionPrefixCount(int divisionPrefixLength)
public java.math.BigInteger getCount()
AddressItempublic boolean isBoundedBy(int value)
public boolean matches(long value)
public boolean matchesWithMask(long value,
long mask)
public boolean matchesWithMask(long lowerValue,
long upperValue,
long mask)
lowerValue - upperValue - mask - public boolean equals(java.lang.Object o)
AddressDivisionBaseequals in class AddressDivisionBasepublic boolean hasUppercaseVariations(int radix,
boolean lowerOnly)
public int getDigitCount(int radix)
AddressStringDivisionpublic int getMaxDigitCount(int radix)
AddressStringDivision