- java.lang.Object
-
- inet.ipaddr.format.AddressDivisionGroupingBase
-
- inet.ipaddr.format.standard.AddressDivisionGrouping
-
- All Implemented Interfaces:
AddressDivisionSeries
,AddressItem
,AddressStringDivisionSeries
,java.io.Serializable
,java.lang.Comparable<AddressItem>
- Direct Known Subclasses:
IPAddressDivisionGrouping
,MACAddressSection
public class AddressDivisionGrouping extends AddressDivisionGroupingBase
AddressDivisionGrouping objects consist of a series of AddressDivision objects, each division containing one or more segments.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.
- Author:
- sfoley
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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 Summary
Constructors Constructor Description AddressDivisionGrouping(AddressDivision[] divisions)
AddressDivisionGrouping(AddressDivision[] divisions, boolean checkDivisions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsPrefixBlock(int prefixLength)
Returns whether the values of this division grouping contain the prefix block for the given prefix lengthboolean
containsSinglePrefixBlock(int prefixLength)
Returns whether the values of this division grouping match the prefix block for the given prefix lengthboolean
equals(java.lang.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()
-
Methods inherited from class inet.ipaddr.format.AddressDivisionGroupingBase
getBytes, getBytes, getBytes, getCount, getDivisionCount, getDivisionStrings, getMinPrefixLengthForBlock, getPrefixCount, getPrefixLength, getPrefixLengthForSingleBlock, getUpperBytes, getUpperBytes, getUpperBytes, getUpperValue, getValue, includesMax, includesZero, isFullRange, isMax, isMultiple, isPrefixBlock, isPrefixed, isSinglePrefixBlock, isZero, toString
-
Methods inherited from interface inet.ipaddr.format.AddressDivisionSeries
getBitCount, getBlockCount, getPrefixCount, getSequentialBlockIndex, isMore, isSequential
-
Methods inherited from interface inet.ipaddr.format.AddressItem
compareTo, getByteCount
-
-
-
-
Constructor Detail
-
AddressDivisionGrouping
public AddressDivisionGrouping(AddressDivision[] divisions)
-
AddressDivisionGrouping
public AddressDivisionGrouping(AddressDivision[] divisions, boolean checkDivisions)
-
-
Method Detail
-
getDivision
public AddressDivision getDivision(int index)
- Specified by:
getDivision
in interfaceAddressDivisionSeries
- Specified by:
getDivision
in interfaceAddressStringDivisionSeries
- Overrides:
getDivision
in classAddressDivisionGroupingBase
- Returns:
- the given division in this series. The first is at index 0.
-
containsPrefixBlock
public boolean containsPrefixBlock(int prefixLength)
Returns whether the values of this division grouping contain the prefix block for the given prefix length- Parameters:
prefixLength
-- Returns:
-
containsSinglePrefixBlock
public boolean containsSinglePrefixBlock(int prefixLength)
Returns whether the values of this division grouping match the prefix block for the given prefix length- Parameters:
prefixLength
-- Returns:
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAddressDivisionGroupingBase
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:AddressDivisionGroupingBase
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.- Overrides:
equals
in classAddressDivisionGroupingBase
-
-