java.lang.Object
inet.ipaddr.format.validate.ParsedIPAddress
- All Implemented Interfaces:
IPAddressProvider
,Serializable
The result from parsing a valid address string. This can be converted into an
IPv4Address
or IPv6Address
instance.- Author:
- sfoley
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
static class
static class
static class
The analog to SpecificValueMasker for oringstatic class
When the part of a mask covering a range of values is a mix of ones and zeros, then there may be an intermediate value in the range that when masked, produces the new upper and lower values.static class
Nested classes/interfaces inherited from interface inet.ipaddr.format.validate.IPAddressProvider
IPAddressProvider.AdjustedAddressCreator, IPAddressProvider.AllCreator, IPAddressProvider.CachedAddressCreator, IPAddressProvider.CachedAddressProvider, IPAddressProvider.IPType, IPAddressProvider.LoopbackCreator, IPAddressProvider.MaskCreator, IPAddressProvider.NullProvider, IPAddressProvider.VersionedAddressCreator
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from interface inet.ipaddr.format.validate.IPAddressProvider
EMPTY_PROVIDER, INVALID_PROVIDER, NO_TYPE_PROVIDER
-
Method Summary
Modifier and TypeMethodDescriptionstatic ParsedIPAddress.BitwiseOrer
bitwiseOrRange
(long value, long upperValue, long maskValue) static ParsedIPAddress.BitwiseOrer
bitwiseOrRange
(long value, long upperValue, long maskValue, long maxValue) contains
(IPAddressProvider other) An optimized contains that does not need to create address objects to return an answer.An optimized contains that does not need to fully parse the other address to return an answer.If the address was created by parsing, this provides the parameters used when creating the address.getProviderAddress
(IPAddress.IPVersion version) int
getType()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
static ParsedIPAddress.Masker
maskRange
(long value, long upperValue, long maskValue) static ParsedIPAddress.Masker
maskRange
(long value, long upperValue, long maskValue, long maxValue) maskRange
(long value, long extendedValue, long upperValue, long extendedUpperValue, long maskValue, long extendedMaskValue, long maxValue, long extendedMaxValue) parsedEquals
(IPAddressProvider other) An optimized equality comparison that does not need to create addresses to return an answer.prefixContains
(IPAddressProvider other) An optimized prefix comparison that does not need to create addresses to return an answer.prefixContains
(String other) An optimized prefix comparison that does not need to create addresses to return an answer.prefixEquals
(IPAddressProvider other) An optimized prefix comparison that does not need to create addresses to return an answer.prefixEquals
(String other) An optimized prefix comparison that does not need to fully parse the other address to return an answer.toString()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface inet.ipaddr.format.validate.IPAddressProvider
getProviderIPVersion, hasPrefixSeparator, isInvalid, isProvidingAllAddresses, isProvidingBase85IPv6, isProvidingEmpty, isProvidingIPv4, isProvidingIPv6, isProvidingMixedIPv6, isProvidingPrefixOnly, isUninitialized, providerCompare, providerEquals, providerHashCode
-
Field Details
-
KEY_WILDCARD
public static final int KEY_WILDCARD- See Also:
-
KEY_SINGLE_WILDCARD
public static final int KEY_SINGLE_WILDCARD- See Also:
-
KEY_STANDARD_STR
public static final int KEY_STANDARD_STR- See Also:
-
KEY_STANDARD_RANGE_STR
public static final int KEY_STANDARD_RANGE_STR- See Also:
-
KEY_RANGE_WILDCARD
public static final int KEY_RANGE_WILDCARD- See Also:
-
KEY_INFERRED_LOWER_BOUNDARY
public static final int KEY_INFERRED_LOWER_BOUNDARY- See Also:
-
KEY_INFERRED_UPPER_BOUNDARY
public static final int KEY_INFERRED_UPPER_BOUNDARY- See Also:
-
KEY_MERGED_MIXED
public static final int KEY_MERGED_MIXED- See Also:
-
KEY_LOWER_RADIX_INDEX
public static final int KEY_LOWER_RADIX_INDEX- See Also:
-
KEY_BIT_SIZE_INDEX
public static final int KEY_BIT_SIZE_INDEX- See Also:
-
FLAGS_INDEX
public static final int FLAGS_INDEX- See Also:
-
KEY_UPPER_RADIX_INDEX
public static final int KEY_UPPER_RADIX_INDEX- See Also:
-
KEY_LOWER
public static final int KEY_LOWER- See Also:
-
KEY_EXTENDED_LOWER
public static final int KEY_EXTENDED_LOWER- See Also:
-
KEY_UPPER
public static final int KEY_UPPER- See Also:
-
KEY_EXTENDED_UPPER
public static final int KEY_EXTENDED_UPPER- See Also:
-
KEY_LOWER_STR_DIGITS_INDEX
public static final int KEY_LOWER_STR_DIGITS_INDEX- See Also:
-
KEY_LOWER_STR_START_INDEX
public static final int KEY_LOWER_STR_START_INDEX- See Also:
-
KEY_LOWER_STR_END_INDEX
public static final int KEY_LOWER_STR_END_INDEX- See Also:
-
KEY_UPPER_STR_DIGITS_INDEX
public static final int KEY_UPPER_STR_DIGITS_INDEX- See Also:
-
KEY_UPPER_STR_START_INDEX
public static final int KEY_UPPER_STR_START_INDEX- See Also:
-
KEY_UPPER_STR_END_INDEX
public static final int KEY_UPPER_STR_END_INDEX- See Also:
-
-
Method Details
-
isProvidingIPAddress
public boolean isProvidingIPAddress()- Specified by:
isProvidingIPAddress
in interfaceIPAddressProvider
-
getType
- Specified by:
getType
in interfaceIPAddressProvider
-
getParameters
Description copied from interface:IPAddressProvider
If the address was created by parsing, this provides the parameters used when creating the address.- Specified by:
getParameters
in interfaceIPAddressProvider
- Returns:
- the parameters used to create the address, or null if no such parameters were used.
-
getProviderSeqRange
- Specified by:
getProviderSeqRange
in interfaceIPAddressProvider
-
getProviderMask
- Specified by:
getProviderMask
in interfaceIPAddressProvider
-
getDivisionGrouping
- Specified by:
getDivisionGrouping
in interfaceIPAddressProvider
- Throws:
IncompatibleAddressException
-
maskRange
public static ParsedIPAddress.ExtendedMasker maskRange(long value, long extendedValue, long upperValue, long extendedUpperValue, long maskValue, long extendedMaskValue, long maxValue, long extendedMaxValue) -
maskRange
- Parameters:
value
-upperValue
-maskValue
-- Returns:
- an instance what will produce the result of masking the values -1 if not compatible and x where x >= 0 if compatible. If x is 0, then the resulting masked range is (value invalid input: '&' maskValue) to (upperValue invalid input: '&' maskValue). If x > 0, then the resulting masked range is (value invalid input: '&' maskValue invalid input: '&' lowerMask) to ((upperValue invalid input: '&' maskValue) | upperMask) where upperMask is ~0 >>> x and lowerMask = ~upperMask.
-
maskRange
public static ParsedIPAddress.Masker maskRange(long value, long upperValue, long maskValue, long maxValue) -
bitwiseOrRange
public static ParsedIPAddress.BitwiseOrer bitwiseOrRange(long value, long upperValue, long maskValue) -
bitwiseOrRange
public static ParsedIPAddress.BitwiseOrer bitwiseOrRange(long value, long upperValue, long maskValue, long maxValue) -
isSequential
public boolean isSequential()- Specified by:
isSequential
in interfaceIPAddressProvider
-
getProviderHostAddress
- Specified by:
getProviderHostAddress
in interfaceIPAddressProvider
- Throws:
IncompatibleAddressException
-
getProviderAddress
- Specified by:
getProviderAddress
in interfaceIPAddressProvider
- Throws:
IncompatibleAddressException
-
getProviderAddress
public IPAddress getProviderAddress(IPAddress.IPVersion version) throws IncompatibleAddressException - Specified by:
getProviderAddress
in interfaceIPAddressProvider
- Throws:
IncompatibleAddressException
-
contains
Description copied from interface:IPAddressProvider
An optimized contains that does not need to fully parse the other address to return an answer. Unconventional addresses may require full parsing, in such cases null is returned. Addresses constructed from canonical or normalized representations with no wildcards will not return null.- Specified by:
contains
in interfaceIPAddressProvider
- Parameters:
other
-- Returns:
-
prefixContains
Description copied from interface:IPAddressProvider
An optimized prefix comparison that does not need to create addresses to return an answer. Unconventional addresses may require the address objects, in such cases null is returned.- Specified by:
prefixContains
in interfaceIPAddressProvider
- Parameters:
other
-- Returns:
-
prefixEquals
Description copied from interface:IPAddressProvider
An optimized prefix comparison that does not need to fully parse the other address to return an answer. Unconventional addresses may require full parsing, in such cases null is returned. Addresses constructed from canonical or normalized representations with no wildcards will not return null.- Specified by:
prefixEquals
in interfaceIPAddressProvider
- Parameters:
other
-- Returns:
-
contains
Description copied from interface:IPAddressProvider
An optimized contains that does not need to create address objects to return an answer. Unconventional addresses may require that the address objects are created, in such cases null is returned. Addresses constructed from canonical or normalized representations with no wildcards will not return null.- Specified by:
contains
in interfaceIPAddressProvider
- Parameters:
other
-- Returns:
-
parsedEquals
Description copied from interface:IPAddressProvider
An optimized equality comparison that does not need to create addresses to return an answer. Unconventional addresses may require the address objects, in such cases null is returned.- Specified by:
parsedEquals
in interfaceIPAddressProvider
- Parameters:
other
-- Returns:
-
prefixContains
Description copied from interface:IPAddressProvider
An optimized prefix comparison that does not need to create addresses to return an answer. Unconventional addresses may require the address objects, in such cases null is returned.- Specified by:
prefixContains
in interfaceIPAddressProvider
- Parameters:
other
-- Returns:
-
prefixEquals
Description copied from interface:IPAddressProvider
An optimized prefix comparison that does not need to create addresses to return an answer. Unconventional addresses may require the address objects, in such cases null is returned.- Specified by:
prefixEquals
in interfaceIPAddressProvider
- Parameters:
other
-- Returns:
-
getProviderNetworkPrefixLength
- Specified by:
getProviderNetworkPrefixLength
in interfaceIPAddressProvider
-
getProviderIPVersion
-
isProvidingIPv6
public boolean isProvidingIPv6() -
isProvidingIPv4
public boolean isProvidingIPv4() -
hasPrefixSeparator
public boolean hasPrefixSeparator() -
isProvidingBase85IPv6
public boolean isProvidingBase85IPv6() -
isProvidingMixedIPv6
public boolean isProvidingMixedIPv6() -
toString
-
getSegmentCount
public int getSegmentCount() -
isProvidingEmpty
public boolean isProvidingEmpty()
-