public class AddressDivisionGrouping extends java.lang.Object implements AddressDivisionSeries, java.lang.Comparable<AddressDivisionGrouping>
AddressDivisionGrouping objects are immutable. This also makes them thread-safe.
| Modifier and Type | Class and Description | 
|---|---|
| static class  | AddressDivisionGrouping.StringOptionsRepresents a clear way to create a specific type of string. | 
| Constructor and Description | 
|---|
| AddressDivisionGrouping(AddressDivision[] divisions) | 
| AddressDivisionGrouping(AddressDivision[] divisions,
                       boolean checkDivisions) | 
| Modifier and Type | Method and Description | 
|---|---|
| int | compareTo(AddressDivisionGrouping other) | 
| boolean | containsPrefixBlock(int prefixLength)Returns whether the values of this division grouping contain the prefix block for the given prefix length | 
| boolean | containsSinglePrefixBlock(int prefixLength)Returns whether the values of this division grouping match the prefix block for the given prefix length | 
| boolean | equals(java.lang.Object o) | 
| int | getBitCount() | 
| byte[] | getBytes()Gets the bytes for the lowest address in the range represented by this address. | 
| byte[] | getBytes(byte[] bytes)Gets the value for the lowest address in the range represented by this address division. | 
| java.math.BigInteger | getCount()gets the count of addresses that this address may represent
 
 If this address division grouping is not a subnet block of multiple addresses or has no range of values, then there is only one such address. | 
| AddressDivision | getDivision(int index) | 
| int | getDivisionCount() | 
| java.lang.String[] | getDivisionStrings()Get standard-format strings for each of the divisions in the series. | 
| int | getMinPrefixLengthForBlock()Returns the smallest prefix length possible such that this address division grouping includes the block of addresses for that prefix. | 
| java.math.BigInteger | getPrefixCount()If this has a prefix length, the count of the range of values in the prefix. | 
| 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. | 
| java.lang.Integer | getPrefixLengthForSingleBlock()Returns a prefix length for which the range of this segment grouping matches the the block of addresses for that prefix. | 
| byte[] | getUpperBytes()Gets the bytes for the highest address in the range represented by this address. | 
| byte[] | getUpperBytes(byte[] bytes)Copies the bytes of the largest address item represented by this address item into the supplied array,
 and returns that array. | 
| java.math.BigInteger | getUpperValue() | 
| java.math.BigInteger | getValue() | 
| int | hashCode() | 
| boolean | includesMax() | 
| boolean | includesZero() | 
| boolean | isFullRange() | 
| boolean | isMax() | 
| int | isMore(AddressDivisionSeries other)Use this method to compare the counts of two address series. | 
| boolean | isMultiple()Whether this represents multiple potential values (eg a prefixed address or a segment representing a range of values) | 
| 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. | 
| boolean | isSinglePrefixBlock()Returns whether the range of values matches a single subnet block for the prefix length | 
| boolean | isZero() | 
| java.lang.String | toString() | 
public AddressDivisionGrouping(AddressDivision[] divisions)
public AddressDivisionGrouping(AddressDivision[] divisions, boolean checkDivisions)
public AddressDivision getDivision(int index)
getDivision in interface AddressDivisionSeriesgetDivision in interface AddressStringDivisionSeriespublic int getDivisionCount()
getDivisionCount in interface AddressStringDivisionSeriespublic int getBitCount()
getBitCount in interface AddressItempublic byte[] getBytes()
Since bytes are signed values while addresses are unsigned, values greater than 127 are represented as the (negative) two's complement value of the actual value. You can get the unsigned integer value i from byte b using i = 0xff & b.
getBytes in interface AddressItempublic byte[] getBytes(byte[] bytes)
If the value fits in the specified array, the same array is returned with the value. Otherwise, a new array is allocated and returned with the value.
 You can use getBitCount() to determine the required array length for the bytes.
 
Since bytes are signed values while addresses are unsigned, values greater than 127 are represented as the (negative) two's complement value of the actual value. You can get the unsigned integer value i from byte b using i = 0xff & b.
getBytes in interface AddressItempublic byte[] getUpperBytes()
getUpperBytes in interface AddressItempublic byte[] getUpperBytes(byte[] bytes)
AddressItemgetUpperBytes in interface AddressItempublic java.math.BigInteger getValue()
getValue in interface AddressDivisionSeriespublic java.math.BigInteger getUpperValue()
getUpperValue in interface AddressDivisionSeriespublic boolean isPrefixed()
AddressDivisionSeriesisPrefixed in interface AddressDivisionSeriespublic java.lang.Integer getPrefixLength()
AddressDivisionSeriesTypically 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 AddressDivisionSeries.getMinPrefixLengthForBlock() and AddressDivisionSeries.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.
getPrefixLength in interface AddressDivisionSeriespublic int getMinPrefixLengthForBlock()
getMinPrefixLengthForBlock in interface AddressDivisionSeriespublic java.lang.Integer getPrefixLengthForSingleBlock()
getPrefixLengthForSingleBlock in interface AddressDivisionSeriespublic java.math.BigInteger getCount()
getCount in interface AddressItempublic java.math.BigInteger getPrefixCount()
AddressDivisionSeries
 If this has no prefix length, returns the same value as AddressItem.getCount()
getPrefixCount in interface AddressDivisionSeriespublic int isMore(AddressDivisionSeries other)
AddressDivisionSeriesisMore in interface AddressDivisionSeriespublic boolean isMultiple()
AddressItemisMultiple in interface AddressItempublic boolean isSinglePrefixBlock()
AddressDivisionSeriesisSinglePrefixBlock in interface AddressDivisionSeriespublic boolean isPrefixBlock()
AddressDivisionSeriesThis 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.
isPrefixBlock in interface AddressDivisionSeriespublic boolean containsPrefixBlock(int prefixLength)
containsPrefixBlock in interface AddressDivisionSeriesprefixLength - public boolean containsSinglePrefixBlock(int prefixLength)
containsSinglePrefixBlock in interface AddressDivisionSeriesprefixLength - public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int compareTo(AddressDivisionGrouping other)
compareTo in interface java.lang.Comparable<AddressDivisionGrouping>public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String[] getDivisionStrings()
AddressDivisionSeriesgetDivisionStrings in interface AddressDivisionSeriespublic boolean isZero()
isZero in interface AddressItempublic boolean includesZero()
includesZero in interface AddressItempublic boolean isMax()
isMax in interface AddressItempublic boolean includesMax()
includesMax in interface AddressItempublic boolean isFullRange()
isFullRange in interface AddressItem