- java.lang.Object
-
- inet.ipaddr.format.validate.ParsedAddressGrouping
-
public class ParsedAddressGrouping extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ParsedAddressGrouping()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Integer
cache(int i)
static java.lang.Integer
getDivisionPrefixLength(int divisionBits, int divisionPrefixedBits)
Across an address prefixes are: IPv6: (null):...:(null):(1 to 16):(0):...:(0) or IPv4: ...(null).(1 to 8).(0)...static int
getHostSegmentIndex(int networkPrefixLength, int bytesPerSegment, int bitsPerSegment)
Returns the index of the segment containing the first byte outside the network prefix.static java.lang.Integer
getNetworkPrefixLength(int bitsPerSegment, int segmentPrefixLength, int segmentIndex)
Translates a non-null segment prefix length into an address prefix length.static int
getNetworkSegmentIndex(int networkPrefixLength, int bytesPerSegment, int bitsPerSegment)
Returns the index of the segment containing the last byte within the network prefix When networkPrefixLength is zero (so there are no segments containing bytes within the network prefix), returns -1static java.lang.Integer
getPrefixedSegmentPrefixLength(int bitsPerSegment, int prefixLength, int segmentIndex)
static java.lang.Integer
getSegmentPrefixLength(int bitsPerSegment, java.lang.Integer prefixLength, int segmentIndex)
Across an address prefixes are: IPv6: (null):...:(null):(1 to 16):(0):...:(0) or IPv4: ...(null).(1 to 8).(0)...static int
getTotalBits(int segmentCount, int bytesPerSegment, int bitsPerSegment)
Returns the total number of bits for the given segment count, with each segment having the given number of bits.static boolean
isPrefixSubnet(Address.SegmentValueProvider lowerValueProvider, Address.SegmentValueProvider upperValueProvider, int segmentCount, int bytesPerSegment, int bitsPerSegment, int segmentMaxValue, java.lang.Integer networkPrefixLength, AddressNetwork.PrefixConfiguration prefixConfiguration, boolean fullRangeOnly)
static boolean
isPrefixSubnet(AddressDivisionGrouping.DivisionValueProvider lowerValueProvider, AddressDivisionGrouping.DivisionValueProvider lowerExtendedValueProvider, AddressDivisionGrouping.DivisionValueProvider upperValueProvider, AddressDivisionGrouping.DivisionValueProvider upperExtendedValueProvider, AddressDivisionGrouping.DivisionLengthProvider bitLengthProvider, int divisionCount, java.lang.Integer networkPrefixLength, AddressNetwork.PrefixConfiguration prefixConfiguration, boolean fullRangeOnly)
-
-
-
Method Detail
-
getNetworkSegmentIndex
public static int getNetworkSegmentIndex(int networkPrefixLength, int bytesPerSegment, int bitsPerSegment)
Returns the index of the segment containing the last byte within the network prefix When networkPrefixLength is zero (so there are no segments containing bytes within the network prefix), returns -1- Parameters:
networkPrefixLength
-byteLength
-- Returns:
-
getHostSegmentIndex
public static int getHostSegmentIndex(int networkPrefixLength, int bytesPerSegment, int bitsPerSegment)
Returns the index of the segment containing the first byte outside the network prefix. When networkPrefixLength is null, or it matches or exceeds the bit length, returns the segment count.- Parameters:
networkPrefixLength
-byteLength
-- Returns:
-
getTotalBits
public static int getTotalBits(int segmentCount, int bytesPerSegment, int bitsPerSegment)
Returns the total number of bits for the given segment count, with each segment having the given number of bits. The number of bytes must correspond to the number of bits.- Parameters:
segmentCount
-bytesPerSegment
-bitsPerSegment
-- Returns:
-
getSegmentPrefixLength
public static java.lang.Integer getSegmentPrefixLength(int bitsPerSegment, java.lang.Integer prefixLength, int segmentIndex)
Across an address prefixes are: IPv6: (null):...:(null):(1 to 16):(0):...:(0) or IPv4: ...(null).(1 to 8).(0)...
-
getPrefixedSegmentPrefixLength
public static java.lang.Integer getPrefixedSegmentPrefixLength(int bitsPerSegment, int prefixLength, int segmentIndex)
-
getDivisionPrefixLength
public static java.lang.Integer getDivisionPrefixLength(int divisionBits, int divisionPrefixedBits)
Across an address prefixes are: IPv6: (null):...:(null):(1 to 16):(0):...:(0) or IPv4: ...(null).(1 to 8).(0)...
-
getNetworkPrefixLength
public static java.lang.Integer getNetworkPrefixLength(int bitsPerSegment, int segmentPrefixLength, int segmentIndex)
Translates a non-null segment prefix length into an address prefix length. When calling this for the first segment with a non-null prefix length, this gives the overall prefix length.Across an address prefixes are: IPv6: (null):...:(null):(1 to 16):(0):...:(0) or IPv4: ...(null).(1 to 8).(0)...
-
isPrefixSubnet
public static boolean isPrefixSubnet(AddressDivisionGrouping.DivisionValueProvider lowerValueProvider, AddressDivisionGrouping.DivisionValueProvider lowerExtendedValueProvider, AddressDivisionGrouping.DivisionValueProvider upperValueProvider, AddressDivisionGrouping.DivisionValueProvider upperExtendedValueProvider, AddressDivisionGrouping.DivisionLengthProvider bitLengthProvider, int divisionCount, java.lang.Integer networkPrefixLength, AddressNetwork.PrefixConfiguration prefixConfiguration, boolean fullRangeOnly)
-
isPrefixSubnet
public static boolean isPrefixSubnet(Address.SegmentValueProvider lowerValueProvider, Address.SegmentValueProvider upperValueProvider, int segmentCount, int bytesPerSegment, int bitsPerSegment, int segmentMaxValue, java.lang.Integer networkPrefixLength, AddressNetwork.PrefixConfiguration prefixConfiguration, boolean fullRangeOnly)
-
cache
public static java.lang.Integer cache(int i)
-
-