public class AddressDivisionGrouping extends AddressDivisionGroupingBase
AddressDivisionGrouping objects are immutable. This also makes them thread-safe.
AddressDivision objects use long to represent their values, so this places a cap on the size of the divisions in AddressDivisionGrouping.
| Modifier and Type | Class and Description |
|---|---|
static interface |
AddressDivisionGrouping.DivisionLengthProvider |
static interface |
AddressDivisionGrouping.DivisionValueProvider |
static class |
AddressDivisionGrouping.StringOptions
Represents 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 |
|---|---|
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(Object o)
Two groupings are equal if:
- they match type/version (ipv4, ipv6, mac, or a specific grouping class)
- they match division counts
- each division matches bit counts
- each division matches their specific grouping class
- each division matches values
Prefix lengths, for those groupings and/or divisionsS that have them, are ignored.
|
AddressDivision |
getDivision(int index) |
int |
hashCode()
Returns a hash code value for the object.
|
getBytes, getBytes, getBytes, getCount, getDivisionCount, getDivisionStrings, getMinPrefixLengthForBlock, getPrefixCount, getPrefixLength, getPrefixLengthForSingleBlock, getUpperBytes, getUpperBytes, getUpperBytes, getUpperValue, getValue, includesMax, includesZero, isFullRange, isMax, isMultiple, isPrefixBlock, isPrefixed, isSinglePrefixBlock, isZero, toStringgetBitCount, getBlockCount, getPrefixCount, getSequentialBlockIndex, isMore, isSequentialcompareTo, getByteCountpublic AddressDivisionGrouping(AddressDivision[] divisions)
public AddressDivisionGrouping(AddressDivision[] divisions, boolean checkDivisions)
public AddressDivision getDivision(int index)
getDivision in interface AddressDivisionSeriesgetDivision in interface AddressStringDivisionSeriesgetDivision in class AddressDivisionGroupingBasepublic boolean containsPrefixBlock(int prefixLength)
prefixLength - public boolean containsSinglePrefixBlock(int prefixLength)
prefixLength - public int hashCode()
java.lang.ObjectHashMap.
The general contract of hashCode is:
hashCode method
must consistently return the same integer, provided no information
used in equals comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
hashCode in class AddressDivisionGroupingBaseObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public boolean equals(Object o)
AddressDivisionGroupingBaseequals in class AddressDivisionGroupingBaseo - the reference object with which to compare.true if this object is the same as the obj
argument; false otherwise.Object.hashCode(),
HashMap