public class IPAddressDivisionGrouping extends AddressDivisionGrouping implements IPAddressStringDivisionSeries
With the IPAddressSection subclass, each division is one segment (eg either groupings of 4 like 1.2.3.4 or groupings of 8 like 1:2:3:4:5:6:7:8). For IPv6, a compressed segment still counts as one of the groupings, it is simply not printed as part of the text representation. Alternative groupings include ipv4 groupings define by inet_aton (eg groupings of 1, 2, or 3 divisions like 1, 1.2, and 1.2.3) and the mixed ipv6/ipv4 representation of ipv6 addresses (eg a grouping of 10 divisions like a:b:c:d:e:f:1.2.3.4) IPAddressDivisionGrouping objects are immutable. Some of the derived state is created upon demand and cached. This also makes them thread-safe. May be associated with a prefix length, in which case that number of bits in the upper-most portion of the object represent a prefix, while the remaining bits can assume all possible values.
Modifier and Type | Class and Description |
---|---|
static class |
IPAddressDivisionGrouping.Range |
static class |
IPAddressDivisionGrouping.RangeList |
AddressDivisionGrouping.StringOptions
Constructor and Description |
---|
IPAddressDivisionGrouping(IPAddressDivision[] divisions) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
IPAddressDivision |
getDivision(int index) |
java.lang.Integer |
getEquivalentPrefix()
Returns a prefix length for which the range of this segment grouping 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
|
java.lang.Integer |
getNetworkPrefixLength() |
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.
|
IPAddressDivisionGrouping.RangeList |
getZeroRangeSegments() |
IPAddressDivisionGrouping.RangeList |
getZeroSegments() |
int |
isMore(AddressDivisionSeries other)
Use this method to compare the counts of two address series.
|
boolean |
isMultipleByNetworkPrefix() |
boolean |
isMultipleByPrefix()
whether there is a prefix and it is less than the bit-count
|
boolean |
isPrefixed()
Whether there exists a prefix.
|
boolean |
isRangeEquivalentToPrefix()
whether there is a prefix and the range of values is dictated entirely by the prefix.
|
compareTo, getBitCount, getBytes, getBytes, getCount, getDivisionCount, getMinPrefix, getUpperBytes, getUpperBytes, hashCode, isFullRange, isMultiple, isRangeEquivalent, isZero, toString
getDivisionCount
public IPAddressDivisionGrouping(IPAddressDivision[] divisions)
public IPAddressDivision getDivision(int index)
getDivision
in interface AddressDivisionSeries
getDivision
in interface AddressStringDivisionSeries
getDivision
in class AddressDivisionGrouping
public int isMore(AddressDivisionSeries other)
AddressDivisionSeries
isMore
in interface AddressDivisionSeries
isMore
in class AddressDivisionGrouping
public boolean isPrefixed()
AddressDivisionSeries
isPrefixed
in interface AddressDivisionSeries
isPrefixed
in interface IPAddressStringDivisionSeries
isPrefixed
in class AddressDivisionGrouping
public java.lang.Integer getPrefixLength()
AddressDivisionSeries
getPrefixLength
in interface AddressDivisionSeries
getPrefixLength
in interface IPAddressStringDivisionSeries
getPrefixLength
in class AddressDivisionGrouping
public java.lang.Integer getNetworkPrefixLength()
public boolean isMultipleByNetworkPrefix()
public boolean isMultipleByPrefix()
AddressDivisionSeries
isMultipleByPrefix
in interface AddressDivisionSeries
isMultipleByPrefix
in class AddressDivisionGrouping
public boolean isRangeEquivalentToPrefix()
AddressDivisionSeries
isRangeEquivalentToPrefix
in interface AddressDivisionSeries
isRangeEquivalentToPrefix
in class AddressDivisionGrouping
public java.lang.Integer getEquivalentPrefix()
AddressDivisionGrouping
getEquivalentPrefix
in interface AddressDivisionSeries
getEquivalentPrefix
in class AddressDivisionGrouping
public boolean equals(java.lang.Object o)
equals
in class AddressDivisionGrouping
public IPAddressDivisionGrouping.RangeList getZeroSegments()
public IPAddressDivisionGrouping.RangeList getZeroRangeSegments()