inet.ipaddr.format

Interface AddressDivisionSeries

    • Method Detail

      • isMore

        int isMore(AddressDivisionSeries other)
        Use this method to compare the counts of two address series. Rather than calculating counts with getCount(), there can be more efficient ways of comparing whether one series represents more individual address series than another.
        Returns:
        > 0 if this AddressDivisionSeries has a larger count than the provided, 0 if they are the same, < 0 if the other has a larger count.
      • isPrefixed

        boolean isPrefixed()
        Whether there exists a prefix.
      • getPrefixLength

        java.lang.Integer getPrefixLength()
        The bit-length of the portion of the address that is not specific to an individual address but common amongst a group of addresses. Typically this is the largest number of bits in the upper-most portion of the section for which the remaining bits assume all possible values. For IP addresses, this must be explicitly defined when the address is created. For example, 1.2.0.0/16 has a prefix length of 16, while 1.2.*.* has no prefix length, even though they both represent the same set of addresses and are considered equal. Prefixes can be considered variable for any given IP addresses and can depend on the routing table. The methods getMinPrefix and getEquivalentPrefix can help you to obtain or define a prefix length if one does not exist already. 1.2.0.0/16 and 1.2.*.* both the same equivalent and minimum prefix length of 16. For MAC addresses, the prefix is implicit, so 1:2:3:*:*:* has a prefix length of 24 by definition. Generally prefixes are not variable for a given address. Either an address has a prefix or not, the one assigned by the IEEE. There is no way to explicitly define the prefix in a representation of a MAC address. The prefix length is instead determined by the address itself when created.
      • isMultipleByPrefix

        boolean isMultipleByPrefix()
        whether there is a prefix and it is less than the bit-count
        Returns:
      • isRangeEquivalentToPrefix

        boolean isRangeEquivalentToPrefix()
        whether there is a prefix and the range of values is dictated entirely by the prefix.
        Returns:
      • getMinPrefix

        int getMinPrefix()
        Returns the smallest prefix length possible such that this address paired with that prefix length represents the exact same range of addresses. If no such prefix exists, returns the bit length.
        Returns:
        the prefix length
      • getEquivalentPrefix

        java.lang.Integer getEquivalentPrefix()
        Returns a prefix length for which the range of this division series can be specified only using the section's lower value and the prefix length. If no such prefix exists, returns null. If this segment grouping represents a single value, returns the bit length of the address.
        Returns:
        the prefix length or null