Class IPAddressLargeDivision
java.lang.Object
inet.ipaddr.format.AddressDivisionBase
inet.ipaddr.format.large.IPAddressLargeDivision
- All Implemented Interfaces:
AddressGenericDivision, AddressItem, IPAddressGenericDivision, AddressStringDivision, IPAddressStringDivision, Serializable, Comparable<AddressItem>
This class supports a segment or division of an arbitrary number of bits.
For a bit count less than or equal to 63 bits, AddressDivision or IPAddressDivision is a more efficient choice,
which are based on arithmetic using longs and can be grouped with AddressDivisionGrouping and IPAddressDivisionGrouping respectively.
- Author:
- sfoley
- See Also:
-
Field Summary
FieldsFields inherited from class AddressDivisionBase
EXTENDED_DIGITS -
Constructor Summary
ConstructorsConstructorDescriptionIPAddressLargeDivision(byte[] bytes, byte[] upperBytes, int bitCount, int defaultRadix, IPAddressNetwork<?, ?, ?, ?, ?> network, Integer prefixLength) IPAddressLargeDivision(byte[] bytes, int bitCount, int defaultRadix) IPAddressLargeDivision(byte[] bytes, int bitCount, int defaultRadix, IPAddressNetwork<?, ?, ?, ?, ?> network, Integer prefixLength) -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo 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.intProvides the number of bits comprising this address itemintintgetDigitCount(int radix) Returns the count of digits of the value, or if a range, the larger value in the rangeintintgetMaxDigitCount(int radix) Returns the count of digits of the largest possible valueintgetPrefixAdjustedRangeString(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.Produces a normalized string to represent the segment.Returns the highest value represented by this address item, the highest value included in the range of valuesgetValue()Returns the lowest value represented by this address item, the lowest value included in the range of valuesProduces a string to represent the segment, favouring wildcards and range characters over the network prefix to represent subnets.booleanReturns whether this item includes the maximum possible value for the address type or version within its rangebooleanReturns whether this item includes the value of zero within its rangebooleanisBoundedBy(int val) Returns true if the possible values of this division fall below the given boundary value.booleanisMax()Returns whether this item matches the maximum possible value for the address type or versionbooleanWhether this represents multiple potential values (eg a prefixed address or a segment representing a range of values)booleanReturns whether the division range includes the block of values for its prefix lengthbooleanbooleanReturns whether the division range matches the block of values for its prefix lengthbooleanisZero()Returns whether this item matches the value of zeroMethods inherited from class AddressDivisionBase
getBytes, getBytes, getBytes, getDigitCount, getDigitCount, getLowerStandardString, getStandardString, getUpperBytes, getUpperBytes, getUpperBytes, hashCode, toStringMethods inherited from interface AddressItem
compareTo, containsPrefixBlock, containsSinglePrefixBlock, getByteCount, getBytes, getBytes, getBytes, getCount, getMinPrefixLengthForBlock, getPrefixCount, getPrefixLengthForSingleBlock, getUpperBytes, getUpperBytes, getUpperBytesMethods inherited from interface AddressStringDivision
getLowerStandardString, getStandardStringMethods inherited from interface IPAddressGenericDivision
isFullRange
-
Field Details
-
EXTENDED_DIGITS_RANGE_SEPARATOR
public static final char EXTENDED_DIGITS_RANGE_SEPARATOR- See Also:
-
EXTENDED_DIGITS_RANGE_SEPARATOR_STR
-
-
Constructor Details
-
IPAddressLargeDivision
public IPAddressLargeDivision(byte[] bytes, int bitCount, int defaultRadix) throws AddressValueException - Throws:
AddressValueException
-
IPAddressLargeDivision
public IPAddressLargeDivision(byte[] bytes, int bitCount, int defaultRadix, IPAddressNetwork<?, ?, throws AddressValueException?, ?, ?> network, Integer prefixLength) - Parameters:
bytes-bitCount-defaultRadix-network- can be null if prefixLength is nullprefixLength-- Throws:
AddressValueException
-
IPAddressLargeDivision
public IPAddressLargeDivision(byte[] bytes, byte[] upperBytes, int bitCount, int defaultRadix, IPAddressNetwork<?, ?, throws AddressValueException?, ?, ?> network, Integer prefixLength) - Throws:
AddressValueException
-
-
Method Details
-
getValue
Description copied from interface:AddressItemReturns the lowest value represented by this address item, the lowest value included in the range of values- Specified by:
getValuein interfaceAddressItem- Returns:
- the lowest value represented by this address item
-
getUpperValue
Description copied from interface:AddressItemReturns the highest value represented by this address item, the highest value included in the range of values- Specified by:
getUpperValuein interfaceAddressItem- Returns:
- the highest value represented by this address item
-
isBoundedBy
public boolean isBoundedBy(int val) Description copied from interface:AddressStringDivisionReturns true if the possible values of this division fall below the given boundary value.- Specified by:
isBoundedByin interfaceAddressStringDivision
-
getDigitCount
public int getDigitCount(int radix) Description copied from interface:AddressStringDivisionReturns the count of digits of the value, or if a range, the larger value in the range- Specified by:
getDigitCountin interfaceAddressStringDivision- Parameters:
radix-- Returns:
-
getBitCount
public int getBitCount()Description copied from interface:AddressItemProvides the number of bits comprising this address item- Specified by:
getBitCountin interfaceAddressItem- Specified by:
getBitCountin interfaceIPAddressStringDivision- Returns:
- the number of bits
-
isMultiple
public boolean isMultiple()Description copied from interface:AddressItemWhether this represents multiple potential values (eg a prefixed address or a segment representing a range of values)- Specified by:
isMultiplein interfaceAddressItem
-
includesZero
public boolean includesZero()Description copied from interface:AddressItemReturns whether this item includes the value of zero within its range- Specified by:
includesZeroin interfaceAddressItem- Returns:
- whether this item includes the value of zero within its range
-
includesMax
public boolean includesMax()Description copied from interface:AddressItemReturns whether this item includes the maximum possible value for the address type or version within its range- Specified by:
includesMaxin interfaceAddressItem- Returns:
- whether this item includes the maximum possible value within its range
-
isMax
public boolean isMax()Description copied from interface:AddressItemReturns whether this item matches the maximum possible value for the address type or version- Specified by:
isMaxin interfaceAddressItem- Returns:
- whether this item matches the maximum possible value
-
isZero
public boolean isZero()Description copied from interface:AddressItemReturns whether this item matches the value of zero- Specified by:
isZeroin interfaceAddressItem- Returns:
- whether this item matches the value of zero
-
getDefaultTextualRadix
public int getDefaultTextualRadix() -
getMaxDigitCount
public int getMaxDigitCount() -
getMaxDigitCount
public int getMaxDigitCount(int radix) Description copied from interface:AddressStringDivisionReturns the count of digits of the largest possible value- Specified by:
getMaxDigitCountin interfaceAddressStringDivision- Parameters:
radix-- Returns:
-
getString
Produces a normalized string to represent the segment. If the segment CIDR prefix length covers the range, then it is assumed to be a CIDR, and the string has only the lower value of the CIDR range. Otherwise, the explicit range will be printed.- Returns:
-
getWildcardString
Produces a string to represent the segment, favouring wildcards and range characters over the network prefix to represent subnets. If it exists, the segment CIDR prefix is ignored and the explicit range is printed.- Returns:
-
getPrefixAdjustedRangeString
public int getPrefixAdjustedRangeString(int segmentIndex, AddressSegmentParams params, StringBuilder appendable) Description copied from interface:IPAddressStringDivisionProduces 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.- Specified by:
getPrefixAdjustedRangeStringin interfaceIPAddressStringDivision- Returns:
- if the supplied appendable is null, returns the length of the string that would have been appended, otherwise returns 0
-
isPrefixBlock
public boolean isPrefixBlock()Description copied from interface:IPAddressStringDivisionReturns whether the division range includes the block of values for its prefix length- Specified by:
isPrefixBlockin interfaceIPAddressStringDivision
-
isSinglePrefixBlock
public boolean isSinglePrefixBlock()Returns whether the division range matches the block of values for its prefix length- Specified by:
isSinglePrefixBlockin interfaceIPAddressStringDivision
-
getDivisionPrefixLength
- Specified by:
getDivisionPrefixLengthin interfaceIPAddressStringDivision
-
isPrefixed
public boolean isPrefixed()- Specified by:
isPrefixedin interfaceIPAddressGenericDivision
-
equals
Description copied from class:AddressDivisionBaseTwo 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.- Overrides:
equalsin classAddressDivisionBase
-