- 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 interfaceAddressDivisionGrouping.DivisionLengthProviderstatic interfaceAddressDivisionGrouping.DivisionValueProviderstatic classAddressDivisionGrouping.StringOptionsRepresents 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 booleancontainsPrefixBlock(int prefixLength)Returns whether the values of this division grouping contain the prefix block for the given prefix lengthbooleancontainsSinglePrefixBlock(int prefixLength)Returns whether the values of this division grouping match the prefix block for the given prefix lengthbooleanequals(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.AddressDivisiongetDivision(int index)inthashCode()-
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, isSequential, isSinglePrefixBlock, isZero, toString
-
Methods inherited from interface inet.ipaddr.format.AddressDivisionSeries
getBitCount, getBlockCount, getPrefixCount, getSequentialBlockIndex, isMore
-
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:
getDivisionin interfaceAddressDivisionSeries- Specified by:
getDivisionin interfaceAddressStringDivisionSeries- Overrides:
getDivisionin 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:
hashCodein classAddressDivisionGroupingBase
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:AddressDivisionGroupingBaseTwo 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:
equalsin classAddressDivisionGroupingBase
-
-