Module inet.ipaddr

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>

public class IPAddressLargeDivision extends AddressDivisionBase implements IPAddressGenericDivision
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 Details

    • EXTENDED_DIGITS_RANGE_SEPARATOR

      public static final char EXTENDED_DIGITS_RANGE_SEPARATOR
      See Also:
    • EXTENDED_DIGITS_RANGE_SEPARATOR_STR

      public static final String EXTENDED_DIGITS_RANGE_SEPARATOR_STR
    • EXTENDED_DIGITS

      public static final char[] EXTENDED_DIGITS
  • Constructor Details

  • Method Details

    • getValue

      public BigInteger getValue()
      Description copied from interface: AddressItem
      Returns the lowest value represented by this address item, the lowest value included in the range of values
      Specified by:
      getValue in interface AddressItem
      Returns:
      the lowest value represented by this address item
    • getUpperValue

      public BigInteger getUpperValue()
      Description copied from interface: AddressItem
      Returns the highest value represented by this address item, the highest value included in the range of values
      Specified by:
      getUpperValue in interface AddressItem
      Returns:
      the highest value represented by this address item
    • isBoundedBy

      public boolean isBoundedBy(int val)
      Description copied from interface: AddressStringDivision
      Returns true if the possible values of this division fall below the given boundary value.
      Specified by:
      isBoundedBy in interface AddressStringDivision
    • getDigitCount

      public int getDigitCount(int radix)
      Description copied from interface: AddressStringDivision
      Returns the count of digits of the value, or if a range, the larger value in the range
      Specified by:
      getDigitCount in interface AddressStringDivision
      Parameters:
      radix -
      Returns:
    • getBitCount

      public int getBitCount()
      Description copied from interface: AddressItem
      Provides the number of bits comprising this address item
      Specified by:
      getBitCount in interface AddressItem
      Specified by:
      getBitCount in interface IPAddressStringDivision
      Returns:
      the number of bits
    • isMultiple

      public boolean isMultiple()
      Description copied from interface: AddressItem
      Whether this represents multiple potential values (eg a prefixed address or a segment representing a range of values)
      Specified by:
      isMultiple in interface AddressItem
    • includesZero

      public boolean includesZero()
      Description copied from interface: AddressItem
      Returns whether this item includes the value of zero within its range
      Specified by:
      includesZero in interface AddressItem
      Returns:
      whether this item includes the value of zero within its range
    • includesMax

      public boolean includesMax()
      Description copied from interface: AddressItem
      Returns whether this item includes the maximum possible value for the address type or version within its range
      Specified by:
      includesMax in interface AddressItem
      Returns:
      whether this item includes the maximum possible value within its range
    • isMax

      public boolean isMax()
      Description copied from interface: AddressItem
      Returns whether this item matches the maximum possible value for the address type or version
      Specified by:
      isMax in interface AddressItem
      Returns:
      whether this item matches the maximum possible value
    • isZero

      public boolean isZero()
      Description copied from interface: AddressItem
      Returns whether this item matches the value of zero
      Specified by:
      isZero in interface AddressItem
      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: AddressStringDivision
      Returns the count of digits of the largest possible value
      Specified by:
      getMaxDigitCount in interface AddressStringDivision
      Parameters:
      radix -
      Returns:
    • getString

      public String 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

      public String 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: IPAddressStringDivision
      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.
      Specified by:
      getPrefixAdjustedRangeString in interface IPAddressStringDivision
      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: IPAddressStringDivision
      Returns whether the division range includes the block of values for its prefix length
      Specified by:
      isPrefixBlock in interface IPAddressStringDivision
    • isSinglePrefixBlock

      public boolean isSinglePrefixBlock()
      Returns whether the division range matches the block of values for its prefix length
      Specified by:
      isSinglePrefixBlock in interface IPAddressStringDivision
    • getDivisionPrefixLength

      public Integer getDivisionPrefixLength()
      Specified by:
      getDivisionPrefixLength in interface IPAddressStringDivision
    • isPrefixed

      public boolean isPrefixed()
      Specified by:
      isPrefixed in interface IPAddressGenericDivision
    • equals

      public boolean equals(Object other)
      Description copied from class: AddressDivisionBase
      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.
      Overrides:
      equals in class AddressDivisionBase