- java.lang.Object
-
- inet.ipaddr.format.validate.ParsedIPAddress
-
- All Implemented Interfaces:
IPAddressProvider,java.io.Serializable
public class ParsedIPAddress extends java.lang.Object implements IPAddressProvider
The result from parsing a valid address string. This can be converted into anIPv4AddressorIPv6Addressinstance.- Author:
- sfoley
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParsedIPAddress.BitwiseOrerstatic classParsedIPAddress.ExtendedFullRangeMaskerstatic classParsedIPAddress.ExtendedMaskerstatic classParsedIPAddress.ExtendedSpecificValueMaskerstatic classParsedIPAddress.FullRangeBitwiseOrerstatic classParsedIPAddress.FullRangeMaskerstatic classParsedIPAddress.Maskerstatic classParsedIPAddress.SpecificValueBitwiseOrerThe analog to SpecificValueMasker for oringstatic classParsedIPAddress.SpecificValueMaskerWhen 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 classParsedIPAddress.WrappedMasker-
Nested classes/interfaces inherited from interface inet.ipaddr.format.validate.IPAddressProvider
IPAddressProvider.AdjustedAddressCreator, IPAddressProvider.AllCreator, IPAddressProvider.CachedAddressProvider, IPAddressProvider.IPType, IPAddressProvider.LoopbackCreator, IPAddressProvider.MaskCreator, IPAddressProvider.NullProvider, IPAddressProvider.VersionedAddressCreator
-
-
Field Summary
Fields Modifier and Type Field Description static intFLAGS_INDEXstatic intKEY_BIT_SIZE_INDEXstatic intKEY_EXTENDED_LOWERstatic intKEY_EXTENDED_UPPERstatic intKEY_INFERRED_LOWER_BOUNDARYstatic intKEY_INFERRED_UPPER_BOUNDARYstatic intKEY_LOWERstatic intKEY_LOWER_RADIX_INDEXstatic intKEY_LOWER_STR_DIGITS_INDEXstatic intKEY_LOWER_STR_END_INDEXstatic intKEY_LOWER_STR_START_INDEXstatic intKEY_MERGED_MIXEDstatic intKEY_RANGE_WILDCARDstatic intKEY_SINGLE_WILDCARDstatic intKEY_STANDARD_RANGE_STRstatic intKEY_STANDARD_STRstatic intKEY_UPPERstatic intKEY_UPPER_RADIX_INDEXstatic intKEY_UPPER_STR_DIGITS_INDEXstatic intKEY_UPPER_STR_END_INDEXstatic intKEY_UPPER_STR_START_INDEXstatic intKEY_WILDCARD-
Fields inherited from interface inet.ipaddr.format.validate.IPAddressProvider
EMPTY_PROVIDER, INVALID_PROVIDER, NO_TYPE_PROVIDER
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ParsedIPAddress.BitwiseOrerbitwiseOrRange(long value, long upperValue, long maskValue)static ParsedIPAddress.BitwiseOrerbitwiseOrRange(long value, long upperValue, long maskValue, long maxValue)java.lang.Booleancontains(IPAddressProvider other)An optimized contains that does not need to create address objects to return an answer.java.lang.Booleancontains(java.lang.String other)An optimized contains that does not need to fully parse the other address to return an answer.IPAddressDivisionSeriesgetDivisionGrouping()IPAddressStringParametersgetParameters()If the address was created by parsing, this provides the parameters used when creating the address.IPAddressgetProviderAddress()IPAddressgetProviderAddress(IPAddress.IPVersion version)IPAddressgetProviderHostAddress()IPAddress.IPVersiongetProviderIPVersion()IPAddressgetProviderMask()java.lang.IntegergetProviderNetworkPrefixLength()IPAddressSeqRangegetProviderSeqRange()intgetSegmentCount()IPAddressProvider.IPTypegetType()booleanhasPrefixSeparator()booleanisProvidingBase85IPv6()booleanisProvidingEmpty()booleanisProvidingIPAddress()booleanisProvidingIPv4()booleanisProvidingIPv6()booleanisProvidingMixedIPv6()booleanisSequential()static ParsedIPAddress.ExtendedMaskermaskExtendedRange(long value, long extendedValue, long upperValue, long extendedUpperValue, long maskValue, long extendedMaskValue, long maxValue, long extendedMaxValue)static ParsedIPAddress.MaskermaskRange(long value, long upperValue, long maskValue)static ParsedIPAddress.MaskermaskRange(long value, long upperValue, long maskValue, long maxValue)static ParsedIPAddress.ExtendedMaskermaskRange(long value, long extendedValue, long upperValue, long extendedUpperValue, long maskValue, long extendedMaskValue, long maxValue, long extendedMaxValue)Deprecated.use maskExtendedRangejava.lang.BooleanparsedEquals(IPAddressProvider other)An optimized equality comparison that does not need to create addresses to return an answer.java.lang.BooleanprefixContains(IPAddressProvider other)An optimized prefix comparison that does not need to create addresses to return an answer.java.lang.BooleanprefixContains(java.lang.String other)An optimized prefix comparison that does not need to create addresses to return an answer.java.lang.BooleanprefixEquals(IPAddressProvider other)An optimized prefix comparison that does not need to create addresses to return an answer.java.lang.BooleanprefixEquals(java.lang.String other)An optimized prefix comparison that does not need to fully parse the other address to return an answer.java.lang.StringtoString()-
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 Detail
-
KEY_WILDCARD
public static final int KEY_WILDCARD
- See Also:
- Constant Field Values
-
KEY_SINGLE_WILDCARD
public static final int KEY_SINGLE_WILDCARD
- See Also:
- Constant Field Values
-
KEY_STANDARD_STR
public static final int KEY_STANDARD_STR
- See Also:
- Constant Field Values
-
KEY_STANDARD_RANGE_STR
public static final int KEY_STANDARD_RANGE_STR
- See Also:
- Constant Field Values
-
KEY_RANGE_WILDCARD
public static final int KEY_RANGE_WILDCARD
- See Also:
- Constant Field Values
-
KEY_INFERRED_LOWER_BOUNDARY
public static final int KEY_INFERRED_LOWER_BOUNDARY
- See Also:
- Constant Field Values
-
KEY_INFERRED_UPPER_BOUNDARY
public static final int KEY_INFERRED_UPPER_BOUNDARY
- See Also:
- Constant Field Values
-
KEY_MERGED_MIXED
public static final int KEY_MERGED_MIXED
- See Also:
- Constant Field Values
-
KEY_LOWER_RADIX_INDEX
public static final int KEY_LOWER_RADIX_INDEX
- See Also:
- Constant Field Values
-
KEY_BIT_SIZE_INDEX
public static final int KEY_BIT_SIZE_INDEX
- See Also:
- Constant Field Values
-
FLAGS_INDEX
public static final int FLAGS_INDEX
- See Also:
- Constant Field Values
-
KEY_UPPER_RADIX_INDEX
public static final int KEY_UPPER_RADIX_INDEX
- See Also:
- Constant Field Values
-
KEY_LOWER
public static final int KEY_LOWER
- See Also:
- Constant Field Values
-
KEY_EXTENDED_LOWER
public static final int KEY_EXTENDED_LOWER
- See Also:
- Constant Field Values
-
KEY_UPPER
public static final int KEY_UPPER
- See Also:
- Constant Field Values
-
KEY_EXTENDED_UPPER
public static final int KEY_EXTENDED_UPPER
- See Also:
- Constant Field Values
-
KEY_LOWER_STR_DIGITS_INDEX
public static final int KEY_LOWER_STR_DIGITS_INDEX
- See Also:
- Constant Field Values
-
KEY_LOWER_STR_START_INDEX
public static final int KEY_LOWER_STR_START_INDEX
- See Also:
- Constant Field Values
-
KEY_LOWER_STR_END_INDEX
public static final int KEY_LOWER_STR_END_INDEX
- See Also:
- Constant Field Values
-
KEY_UPPER_STR_DIGITS_INDEX
public static final int KEY_UPPER_STR_DIGITS_INDEX
- See Also:
- Constant Field Values
-
KEY_UPPER_STR_START_INDEX
public static final int KEY_UPPER_STR_START_INDEX
- See Also:
- Constant Field Values
-
KEY_UPPER_STR_END_INDEX
public static final int KEY_UPPER_STR_END_INDEX
- See Also:
- Constant Field Values
-
-
Method Detail
-
isProvidingIPAddress
public boolean isProvidingIPAddress()
- Specified by:
isProvidingIPAddressin interfaceIPAddressProvider
-
getType
public IPAddressProvider.IPType getType()
- Specified by:
getTypein interfaceIPAddressProvider
-
getParameters
public IPAddressStringParameters getParameters()
Description copied from interface:IPAddressProviderIf the address was created by parsing, this provides the parameters used when creating the address.- Specified by:
getParametersin interfaceIPAddressProvider- Returns:
- the parameters used to create the address, or null if no such parameters were used.
-
getProviderSeqRange
public IPAddressSeqRange getProviderSeqRange()
- Specified by:
getProviderSeqRangein interfaceIPAddressProvider
-
getProviderMask
public IPAddress getProviderMask()
- Specified by:
getProviderMaskin interfaceIPAddressProvider
-
getProviderHostAddress
public IPAddress getProviderHostAddress() throws IncompatibleAddressException
- Specified by:
getProviderHostAddressin interfaceIPAddressProvider- Throws:
IncompatibleAddressException
-
getProviderAddress
public IPAddress getProviderAddress() throws IncompatibleAddressException
- Specified by:
getProviderAddressin interfaceIPAddressProvider- Throws:
IncompatibleAddressException
-
getProviderAddress
public IPAddress getProviderAddress(IPAddress.IPVersion version) throws IncompatibleAddressException
- Specified by:
getProviderAddressin interfaceIPAddressProvider- Throws:
IncompatibleAddressException
-
getDivisionGrouping
public IPAddressDivisionSeries getDivisionGrouping() throws IncompatibleAddressException
- Specified by:
getDivisionGroupingin interfaceIPAddressProvider- Throws:
IncompatibleAddressException
-
maskRange
@Deprecated public static ParsedIPAddress.ExtendedMasker maskRange(long value, long extendedValue, long upperValue, long extendedUpperValue, long maskValue, long extendedMaskValue, long maxValue, long extendedMaxValue)
Deprecated.use maskExtendedRange- Parameters:
value-extendedValue-upperValue-extendedUpperValue-maskValue-extendedMaskValue-maxValue-extendedMaxValue-- Returns:
-
maskExtendedRange
public static ParsedIPAddress.ExtendedMasker maskExtendedRange(long value, long extendedValue, long upperValue, long extendedUpperValue, long maskValue, long extendedMaskValue, long maxValue, long extendedMaxValue)
-
maskRange
public static ParsedIPAddress.Masker maskRange(long value, long upperValue, long maskValue)
- 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 & maskValue) to (upperValue & maskValue). If x > 0, then the resulting masked range is (value & maskValue & lowerMask) to ((upperValue & 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:
isSequentialin interfaceIPAddressProvider
-
contains
public java.lang.Boolean contains(java.lang.String other)
Description copied from interface:IPAddressProviderAn 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:
containsin interfaceIPAddressProvider- Returns:
-
prefixContains
public java.lang.Boolean prefixContains(java.lang.String other)
Description copied from interface:IPAddressProviderAn 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:
prefixContainsin interfaceIPAddressProvider- Returns:
-
prefixEquals
public java.lang.Boolean prefixEquals(java.lang.String other)
Description copied from interface:IPAddressProviderAn 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:
prefixEqualsin interfaceIPAddressProvider- Returns:
-
contains
public java.lang.Boolean contains(IPAddressProvider other)
Description copied from interface:IPAddressProviderAn 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:
containsin interfaceIPAddressProvider- Returns:
-
parsedEquals
public java.lang.Boolean parsedEquals(IPAddressProvider other)
Description copied from interface:IPAddressProviderAn 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:
parsedEqualsin interfaceIPAddressProvider- Returns:
-
prefixContains
public java.lang.Boolean prefixContains(IPAddressProvider other)
Description copied from interface:IPAddressProviderAn 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:
prefixContainsin interfaceIPAddressProvider- Returns:
-
prefixEquals
public java.lang.Boolean prefixEquals(IPAddressProvider other)
Description copied from interface:IPAddressProviderAn 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:
prefixEqualsin interfaceIPAddressProvider- Returns:
-
getProviderNetworkPrefixLength
public java.lang.Integer getProviderNetworkPrefixLength()
- Specified by:
getProviderNetworkPrefixLengthin interfaceIPAddressProvider
-
getProviderIPVersion
public IPAddress.IPVersion getProviderIPVersion()
-
isProvidingIPv6
public boolean isProvidingIPv6()
-
isProvidingIPv4
public boolean isProvidingIPv4()
-
hasPrefixSeparator
public boolean hasPrefixSeparator()
-
isProvidingBase85IPv6
public boolean isProvidingBase85IPv6()
-
isProvidingMixedIPv6
public boolean isProvidingMixedIPv6()
-
toString
public java.lang.String toString()
-
getSegmentCount
public int getSegmentCount()
-
isProvidingEmpty
public boolean isProvidingEmpty()
-
-