public interface AddressDivisionSeries extends AddressItem, AddressStringDivisionSeries
Modifier and Type | Method and Description |
---|---|
default int |
getBitCount()
Provides the number of bits comprising this address item
|
default BigInteger |
getBlockCount(int divCount)
Returns the count of values in the initial (higher) count of divisions.
|
default BigInteger |
getCount()
The count of possible distinct values for this AddressComponent.
|
AddressGenericDivision |
getDivision(int index) |
String[] |
getDivisionStrings()
Get standard-format strings for each of the divisions in the series.
|
default BigInteger |
getPrefixCount()
If this has a prefix length, the count of the range of values in the prefix.
|
default BigInteger |
getPrefixCount(int prefixLength)
The count of the number of distinct values within the prefix part of the address item, the bits that appear within the prefix length.
|
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.
|
default int |
getSequentialBlockIndex()
Gets the minimal segment index for which all following segments are full-range blocks.
|
default int |
isMore(AddressDivisionSeries other)
Use this method to compare the counts of two address series.
|
boolean |
isPrefixBlock()
Returns whether this address segment series represents a block of addresses associated with its prefix length.
|
boolean |
isPrefixed()
Whether there exists a prefix length associated with this series.
|
default boolean |
isSequential()
Returns whether the series represents a range of values that are sequential.
|
boolean |
isSinglePrefixBlock()
Returns whether the range of values matches a single subnet block for the prefix length
|
compareTo, containsPrefixBlock, containsSinglePrefixBlock, getBitsForCount, getBlockSize, getByteCount, getBytes, getBytes, getBytes, getMinPrefixLengthForBlock, getPrefixLengthForSingleBlock, getUpperBytes, getUpperBytes, getUpperBytes, getUpperValue, getValue, includesMax, includesZero, isFullRange, isMax, isMultiple, isZero
getDivisionCount
default int isMore(AddressDivisionSeries other)
AddressGenericDivision getDivision(int index)
getDivision
in interface AddressStringDivisionSeries
String[] getDivisionStrings()
Integer getPrefixLength()
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 AddressItem.getMinPrefixLengthForBlock()
and AddressItem.getPrefixLengthForSingleBlock()
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 initially defined by the range, so 1:2:3:*:*:* has a prefix length of 24 by definition. Addresses derived from the original may retain the original prefix length regardless of their range.
boolean isPrefixed()
boolean isPrefixBlock()
This returns false if it has no prefix length or if it is a range of addresses that does not include the entire subnet block for the prefix length.
If AddressNetwork.getPrefixConfiguration()
is set to consider all prefixes as subnets, this returns true for any series with a prefix length.
An important distinction of AddressItem.containsPrefixBlock(int)
with this method is that this method returns
false if the series does not have a prefix length assigned to it,
even if there exists one or more prefix lengths for which AddressItem.containsPrefixBlock(int)
returns true.
boolean isSinglePrefixBlock()
An important distinction of this method with AddressItem.containsSinglePrefixBlock(int)
is that this method returns
false if the series does not have a prefix length assigned to it,
even if there exists a prefix length for which AddressItem.containsSinglePrefixBlock(int)
returns true.
default BigInteger getPrefixCount()
If this has no prefix length, returns the same value as getCount()
default BigInteger getPrefixCount(int prefixLength)
AddressItem
getPrefixCount
in interface AddressItem
default BigInteger getCount()
AddressItem
getCount
in interface AddressItem
default BigInteger getBlockCount(int divCount)
default int getBitCount()
AddressItem
getBitCount
in interface AddressItem
default boolean isSequential()
Generally, this means that any division covering a range of values must be followed by divisions that are full range, covering all values.
default int getSequentialBlockIndex()
The segment at this index is not a full-range block unless all segments are full-range. The segment at this index and all following segments form a sequential range. For the full series to be sequential, the preceding segments must be single-valued.