Module inet.ipaddr

Interface IPAddressDivisionSeries

All Superinterfaces:
AddressDivisionSeries, AddressItem, AddressStringDivisionSeries, Comparable<AddressItem>, IPAddressStringDivisionSeries, Serializable
All Known Subinterfaces:
IPAddressSegmentSeries
All Known Implementing Classes:
IPAddress, IPAddressDivisionGrouping, IPAddressLargeDivisionGrouping, IPAddressSection, IPv4Address, IPv4AddressSection, IPv6Address, IPv6AddressSection, IPv6AddressSection.IPv6v4MixedAddressSection

public interface IPAddressDivisionSeries extends AddressDivisionSeries, IPAddressStringDivisionSeries
Represents a series of groups of address divisions or segments. Each group may have a different bit size. This interface is the super interface of all interfaces and classes representing a series of divisions or segments.
Author:
sfoley
  • Method Details

    • getNetworkPrefixLength

      Integer getNetworkPrefixLength()
      Returns the CIDR network prefix length of the series, or null if the series has no associated prefix length.

      Equivalent to AddressDivisionSeries.getPrefixLength(), which is the more general concept of set of address series that share the same set of leading bits. For IP addresses and sections the prefix length and the CIDR network prefix length are the same thing.

      For IP addresses and sections each individual segment has an associated prefix length which is determine by the network prefix length. The segment prefix lengths follow the pattern: null, null, ...., null, x, 0, 0, ..., 0

      For instance, an IPv4 address 1.2.3.4/16 has the network prefix length 16. The segment prefix lengths are [null, 8, 0, 0] The segment prefix lengths of 1.2.3.4/22 are [null, null, 6, 0]

      Returns:
    • getDivision

      IPAddressGenericDivision getDivision(int index)
      Specified by:
      getDivision in interface AddressDivisionSeries
      Specified by:
      getDivision in interface AddressStringDivisionSeries
      Specified by:
      getDivision in interface IPAddressStringDivisionSeries
      Returns:
      the given division in this series. The first is at index 0.