inet.ipaddr.format

Class AddressDivision

    • Method Detail

      • 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
        Returns:
        whether this segment represents multiple values
      • getMaxValue

        public long getMaxValue()
      • isZero

        public boolean isZero()
        Specified by:
        isZero in interface AddressItem
        Returns:
        whether this item matches the value of zero
      • includesZero

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

        public boolean isMax()
        Specified by:
        isMax in interface AddressItem
        Returns:
        whether this item matches the maximum possible value
      • includesMax

        public boolean includesMax()
        Specified by:
        includesMax in interface AddressItem
        Returns:
        whether this item includes the maximum possible value within its range
      • getLowerValue

        public abstract long getLowerValue()
      • getUpperValue

        public abstract long getUpperValue()
      • getDivisionValueCount

        public long getDivisionValueCount()
      • getDivisionPrefixCount

        public long getDivisionPrefixCount(int divisionPrefixLength)
      • getCount

        public java.math.BigInteger getCount()
        Description copied from interface: AddressItem
        The count of possible distinct values for this AddressComponent. If not multiple, this is 1. For instance, if this is the ip address series subnet 0::/64, then the count is 2 to the power of 64. If this is a the segment 3-7, then the count is 5.
        Specified by:
        getCount in interface AddressItem
        Returns:
      • isBoundedBy

        public boolean isBoundedBy(int value)
        Returns true if the possible values of this division fall below the given value.
        Specified by:
        isBoundedBy in interface AddressStringDivision
      • matches

        public boolean matches(long value)
      • matchesWithMask

        public boolean matchesWithMask(long value,
                                       long mask)
      • matchesWithMask

        public 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.
        Parameters:
        lowerValue -
        upperValue -
        mask -
        Returns:
      • isFullRange

        public boolean isFullRange()
        Specified by:
        isFullRange in interface AddressItem
        Returns:
        whether this address item represents all possible values attainable by an address item of this type, or in other words, both includesZero() and includesMax() return true
      • hasUppercaseVariations

        public boolean hasUppercaseVariations(int radix,
                                              boolean lowerOnly)