public abstract class Address extends Object implements AddressSegmentSeries
To construct one from a String use
IPAddressString or MACAddressString
| Modifier and Type | Class and Description |
|---|---|
static interface |
Address.AddressValueProvider |
static interface |
Address.SegmentValueProvider |
| Modifier and Type | Field and Description |
|---|---|
static AddressComparator |
ADDRESS_HIGH_VALUE_COMPARATOR |
static AddressComparator |
ADDRESS_LOW_VALUE_COMPARATOR |
static char |
ALTERNATIVE_RANGE_SEPARATOR |
static String |
ALTERNATIVE_RANGE_SEPARATOR_STR |
static String |
ALTERNATIVE_SEGMENT_WILDCARD_STR |
static AddressComparator |
DEFAULT_ADDRESS_COMPARATOR |
static String |
HEX_PREFIX |
static String |
OCTAL_PREFIX |
static char |
RANGE_SEPARATOR |
static String |
RANGE_SEPARATOR_STR |
static char |
SEGMENT_SQL_SINGLE_WILDCARD |
static String |
SEGMENT_SQL_SINGLE_WILDCARD_STR |
static char |
SEGMENT_SQL_WILDCARD |
static String |
SEGMENT_SQL_WILDCARD_STR |
static char |
SEGMENT_WILDCARD |
static String |
SEGMENT_WILDCARD_STR |
| Modifier and Type | Method and Description |
|---|---|
abstract Address |
adjustPrefixBySegment(boolean nextSegment)
Increases or decreases prefix length to the next segment boundary.
|
abstract Address |
adjustPrefixBySegment(boolean nextSegment,
boolean zeroed)
Increases or decreases prefix length to the next segment boundary.
|
abstract Address |
adjustPrefixLength(int adjustment)
Increases or decreases prefix length by the given increment.
|
abstract Address |
adjustPrefixLength(int adjustment,
boolean zeroed)
Increases or decreases prefix length by the given increment.
|
abstract Address |
applyPrefixLength(int networkPrefixLength)
Deprecated.
|
boolean |
contains(Address other)
Returns whether this is same type and version of the given address and whether it contains all values in the given address or subnet
|
boolean |
containsPrefixBlock(int prefixLength)
Returns whether the values of this series contains the prefix block for the given prefix length.
|
boolean |
containsSinglePrefixBlock(int prefixLength)
Returns whether the values of this series contains a single prefix block for the given prefix length.
|
static IPv4AddressNetwork |
defaultIpv4Network() |
static IPv6AddressNetwork |
defaultIpv6Network() |
static MACAddressNetwork |
defaultMACNetwork() |
boolean |
equals(Object o)
Two Address objects are equal if they represent the same set of addresses.
|
int |
getBitCount()
Provides the number of bits comprising this address item
|
BigInteger |
getBlockCount(int segmentCount)
Returns the count of values in the initial (higher) count of divisions.
|
int |
getByteCount()
Provides the number of bytes required for this address item, rounding up if the bit count is not a multiple of 8
|
byte[] |
getBytes() |
byte[] |
getBytes(byte[] bytes)
Copies the bytes of the lowest address item represented by this address item into the supplied array,
and returns that array.
|
byte[] |
getBytes(byte[] bytes,
int index)
Copies the bytes of the lowest address item represented by this address item into the supplied array starting at the given index,
and returns that array.
|
BigInteger |
getCount()
Gets the count of addresses that this address may represent.
|
int |
getDivisionCount() |
String[] |
getDivisionStrings()
Get standard-format strings for each of the divisions in the series.
|
abstract Iterable<? extends Address> |
getIterable()
Useful for using an instance in a "for-each loop".
|
abstract Address |
getLower()
If this represents a series with ranging values, returns a series representing the lower values of the range.
|
int |
getMinPrefixLengthForBlock()
Returns the smallest prefix length possible such that this includes the block of addresses for that prefix.
|
BigInteger |
getPrefixCount()
If this has a prefix length, the count of the range of values in the prefix.
|
BigInteger |
getPrefixCount(int prefixLength)
Gets the count of prefixes in this address for the given prefix length.
|
Integer |
getPrefixLength()
the largest number of high bits for which this address represents all addresses with the same set of high bits
|
Integer |
getPrefixLengthForSingleBlock()
Returns a prefix length for which the range of this address subnet matches the block of addresses for that prefix.
|
AddressSection |
getSection()
Gets the subsection from the series that comprises all segments
|
int |
getSegmentCount()
Returns the number of segments in this series.
|
void |
getSegments(AddressSegment[] segs)
Copies the existing segments into the given array.
|
void |
getSegments(int start,
int end,
AddressSegment[] segs,
int index)
get the segments from start to end and insert into the segs array at the given index
|
String[] |
getSegmentStrings()
Returns the an array with the values of each segment as they would appear in the normalized with wildcards string.
|
abstract Address |
getUpper()
If this represents a series with ranging values, returns a series representing the upper values of the range
If this represents a series with a single value in each segment, returns this.
|
byte[] |
getUpperBytes()
Gets the bytes for the highest address in the range of addresses represented by this address instance.
|
byte[] |
getUpperBytes(byte[] bytes)
Copies the bytes of the largest address item represented by this address item into the supplied array,
and returns that array.
|
byte[] |
getUpperBytes(byte[] bytes,
int index)
Copies the bytes of the largest address item represented by this address item into the supplied array at the given index,
and returns that array.
|
BigInteger |
getUpperValue()
Returns the highest value represented by this address item, the highest value included in the range of values
|
BigInteger |
getValue()
Returns the lowest value represented by this address item, the lowest value included in the range of values
|
int |
hashCode() |
boolean |
includesMax()
Returns whether this item includes the maximum possible value for the address type or version within its range
|
boolean |
includesZero()
Returns whether this item includes the value of zero within its range
|
abstract Address |
increment(long increment)
Returns the series from the subnet that is the given increment upwards into the subnet range, with the increment of 0
returning the first address in the range.
|
abstract Address |
incrementBoundary(long increment)
If the given increment is positive, adds the value to the upper series (
AddressSegmentSeries.getUpper()) in the subnet range to produce a new series. |
boolean |
isFullRange()
whether this address item represents all possible values attainable by an address item of this type
|
boolean |
isIPAddress()
Returns whether this address is an IP address
|
abstract boolean |
isLocal()
Whether the address can be considered a local address (as opposed to a global one)
|
boolean |
isMACAddress()
Returns whether this address is a MAC address
|
boolean |
isMax()
Returns whether this item matches the maximum possible value for the address type or version
|
abstract boolean |
isMulticast()
Whether the MAC address or IP address or other form of address is multicast.
|
boolean |
isMultiple()
Returns whether this address represents more than a single individual address, whether it is a subnet.
|
boolean |
isPrefixBlock()
Returns whether the address range has a prefix length and includes the block of values for its prefix length.
|
boolean |
isPrefixed()
Returns whether this address has an associated prefix length
|
boolean |
isSameAddress(Address other) |
boolean |
isSequential()
Returns whether the series represents a range of values that are sequential.
|
boolean |
isSinglePrefixBlock()
Returns whether the address range the block of values for a single prefix identified by its prefix length.
|
boolean |
isZero()
Returns whether this item matches the value of zero
|
abstract Iterator<? extends Address> |
iterator()
Iterates through the individual address components.
|
static boolean |
matchOrdered(Address[] addrs1,
Address[] addrs2)
Checks if the two arrays share the same ordered list of addresses, subnets, or address collections, using address equality.
|
static boolean |
matchUnordered(Address[] addrs1,
Address[] addrs2)
Checks if the two arrays share the same list of addresses, subnets, or address collections, in any order, using address equality.
|
abstract Iterator<? extends Address> |
prefixBlockIterator()
Iterates through the individual prefix blocks.
|
abstract AddressComponentSpliterator<? extends Address> |
prefixBlockSpliterator()
Partitions and traverses through the individual prefix blocks for the prefix length of this series.
|
abstract Stream<? extends Address> |
prefixBlockStream()
Returns a sequential stream of the individual prefix blocks for the prefix length of this series.
|
boolean |
prefixEquals(Address other) |
abstract Iterator<? extends Address> |
prefixIterator()
Iterates through the individual prefixes.
|
abstract AddressComponentSpliterator<? extends Address> |
prefixSpliterator()
Partitions and traverses through the individual prefixes for the prefix length of this series.
|
abstract Stream<? extends Address> |
prefixStream()
Returns a sequential stream of the individual prefixes for the prefix length of this series.
|
abstract Address |
removePrefixLength()
Deprecated.
|
abstract Address |
removePrefixLength(boolean zeroed)
Deprecated.
|
abstract Address |
reverseBits(boolean perByte)
Returns a new segment series with the bits reversed.
|
abstract Address |
reverseBytes()
Returns a new segment series with the bytes reversed.
|
abstract Address |
reverseBytesPerSegment()
Returns a new segment series with the bytes reversed within each segment.
|
abstract Address |
reverseSegments()
Returns a new segment series with the segments reversed.
|
abstract Address |
setPrefixLength(int prefixLength)
Sets the prefix length.
|
abstract Address |
setPrefixLength(int prefixLength,
boolean zeroed)
Sets the prefix length.
|
abstract AddressComponentSpliterator<? extends Address> |
spliterator()
Partitions and traverses through the individual address components.
|
abstract Stream<? extends Address> |
stream()
Returns a sequential stream of the individual address components.
|
HostIdentifierString |
toAddressString()
Returns a host identifier string representation for this address,
which will be already validated.
|
String |
toCanonicalString()
This produces a canonical string.
|
String |
toCompressedString()
Produce short strings for the address in the usual address format.
|
String |
toHexString(boolean with0xPrefix)
Writes this address as a single hexadecimal value with always the exact same number of characters, with or without a preceding 0x prefix.
|
IPAddress |
toIPAddress()
If this address is an IP address, returns that
IPAddress. |
MACAddress |
toMACAddress()
If this address is a MAC address, returns that
MACAddress. |
String |
toNormalizedString()
The normalized string returned by this method is a common and consistent representation of the address.
|
abstract Address |
toPrefixBlock()
If this series has a prefix length, returns the block for that prefix.
|
String |
toString() |
abstract Address |
withoutPrefixLength()
Provides the same address with no prefix.
|
getBitsPerSegment, getBytesPerSegment, getMaxSegmentValue, getSection, getSection, getSegment, getSegments, isOneBit, segmentsIterator, segmentsSpliterator, segmentsStream, testBitgetDivision, getSequentialBlockIndex, isMoregetNetworkstream, streamcompareTo, getBitsForCount, getBlockSizepublic static final String HEX_PREFIX
public static final String OCTAL_PREFIX
public static final char RANGE_SEPARATOR
public static final String RANGE_SEPARATOR_STR
public static final char ALTERNATIVE_RANGE_SEPARATOR
public static final String ALTERNATIVE_RANGE_SEPARATOR_STR
public static final char SEGMENT_WILDCARD
public static final String SEGMENT_WILDCARD_STR
public static final String ALTERNATIVE_SEGMENT_WILDCARD_STR
public static final char SEGMENT_SQL_WILDCARD
public static final String SEGMENT_SQL_WILDCARD_STR
public static final char SEGMENT_SQL_SINGLE_WILDCARD
public static final String SEGMENT_SQL_SINGLE_WILDCARD_STR
public static final AddressComparator DEFAULT_ADDRESS_COMPARATOR
public static final AddressComparator ADDRESS_LOW_VALUE_COMPARATOR
public static final AddressComparator ADDRESS_HIGH_VALUE_COMPARATOR
public static IPv6AddressNetwork defaultIpv6Network()
public static IPv4AddressNetwork defaultIpv4Network()
public static MACAddressNetwork defaultMACNetwork()
public int getSegmentCount()
AddressSegmentSeriesgetSegmentCount in interface AddressSegmentSeriespublic int getDivisionCount()
getDivisionCount in interface AddressStringDivisionSeriespublic int getBitCount()
AddressItemgetBitCount in interface AddressDivisionSeriesgetBitCount in interface AddressItempublic int getByteCount()
AddressItemgetByteCount in interface AddressItempublic AddressSection getSection()
AddressSegmentSeriesgetSection in interface AddressSegmentSeriespublic void getSegments(AddressSegment[] segs)
AddressSegmentSeriesAddressSegmentSeries.getSegmentCount()getSegments in interface AddressSegmentSeriespublic void getSegments(int start,
int end,
AddressSegment[] segs,
int index)
AddressSegmentSeriesgetSegments in interface AddressSegmentSeriesstart - the first segment index from this series to be includedend - the first segment index to be excludedsegs - the target arrayindex - where to insert the segments in the segs arraypublic abstract Iterable<? extends Address> getIterable()
AddressComponentRangeAddressComponentRange.iterator() directly.getIterable in interface AddressSegmentSeriesgetIterable in interface AddressComponentRangepublic abstract Iterator<? extends Address> iterator()
AddressComponentRangeAn address component can represent an individual segment, address, or section, or it can represent multiple, typically a subnet of addresses or a range of segment or section values.
Call AddressItem.isMultiple() to determine if this instance represents multiple, or AddressItem.getCount() for the count.
iterator in interface AddressSegmentSeriesiterator in interface AddressComponentRangepublic abstract AddressComponentSpliterator<? extends Address> spliterator()
AddressComponentRangespliterator in interface AddressComponentspliterator in interface AddressSegmentSeriesspliterator in interface AddressComponentRangepublic abstract Stream<? extends Address> stream()
AddressComponentRangeBaseStream.parallel() on the returned stream.stream in interface AddressSegmentSeriesstream in interface AddressComponentRangepublic abstract Iterator<? extends Address> prefixIterator()
AddressSegmentSeries
If the series has no prefix length, then this is equivalent to AddressSegmentSeries.iterator()
prefixIterator in interface AddressSegmentSeriespublic abstract AddressComponentSpliterator<? extends Address> prefixSpliterator()
AddressSegmentSeriesprefixSpliterator in interface AddressSegmentSeriespublic abstract Stream<? extends Address> prefixStream()
AddressSegmentSeriesBaseStream.parallel() on the returned stream.prefixStream in interface AddressSegmentSeriespublic abstract Iterator<? extends Address> prefixBlockIterator()
AddressSegmentSeries
If the series has no prefix length, then this is equivalent to AddressSegmentSeries.iterator()
prefixBlockIterator in interface AddressSegmentSeriespublic abstract AddressComponentSpliterator<? extends Address> prefixBlockSpliterator()
AddressSegmentSeriesprefixBlockSpliterator in interface AddressSegmentSeriespublic abstract Stream<? extends Address> prefixBlockStream()
AddressSegmentSeriesBaseStream.parallel() on the returned stream.prefixBlockStream in interface AddressSegmentSeriespublic abstract Address increment(long increment) throws AddressValueException
AddressSegmentSeriesIf the subnet has multiple values and the increment exceeds the subnet size, then the amount by which it exceeds the size - 1 is added to the upper series of the range (the final iterator value).
If the increment is negative, it is added to the lower series of the range (the first iterator value).
If the subnet is just a single address values, the series is simply incremented by the given value, positive or negative.
If a subnet has multiple values, a positive increment value is equivalent to the same number of values from the AddressSegmentSeries.iterator()
For instance, a increment of 0 is the first value from the iterator, an increment of 1 is the second value from the iterator, and so on.
A negative increment added to the subnet count is equivalent to the same number of values preceding the upper bound of the iterator.
For instance, an increment of count - 1 is the last value from the iterator, an increment of count - 2 is the second last value, and so on.
An increment of size count gives you the series just above the highest series of the subnet. To get the series just below the lowest series of the subnet, use the increment -1.
increment in interface AddressSegmentSeriesAddressValueException - in case of underflow or overflowpublic abstract Address incrementBoundary(long increment) throws AddressValueException
AddressSegmentSeriesAddressSegmentSeries.getUpper()) in the subnet range to produce a new series.
If the given increment is negative, adds the value to the lower series (AddressSegmentSeries.getLower()) in the subnet range to produce a new series.
If the increment is zero, returns this.
In the case where the series is a single value, this simply returns the address produced by adding the given increment to this address series.
incrementBoundary in interface AddressSegmentSeriesAddressValueException - in case of underflow or overflowpublic abstract Address getLower()
AddressSegmentSeriesgetLower in interface AddressSegmentSeriesgetLower in interface AddressComponentRangepublic abstract Address getUpper()
AddressSegmentSeriesgetUpper in interface AddressSegmentSeriesgetUpper in interface AddressComponentRangepublic boolean isMultiple()
isMultiple in interface AddressItempublic boolean isPrefixed()
isPrefixed in interface AddressDivisionSeriespublic boolean isIPAddress()
public boolean isMACAddress()
public IPAddress toIPAddress()
IPAddress. Otherwise, returns null.public MACAddress toMACAddress()
MACAddress. Otherwise, returns null.public Integer getPrefixLength()
getPrefixLength in interface AddressDivisionSeriespublic int getMinPrefixLengthForBlock()
If the entire range can be dictated this way, then this method returns the same value as getPrefixLengthForSingleBlock().
Otherwise, this method will return the minimal possible prefix that can be paired with this address, while getPrefixLengthForSingleBlock() will return null.
In cases where the final bit in this address division series is constant, this returns the bit length of this address division series.
getMinPrefixLengthForBlock in interface AddressItempublic Integer getPrefixLengthForSingleBlock()
If the range can be dictated this way, then this method returns the same value as getMinPrefixLengthForBlock().
If no such prefix exists, returns null.
If this segment grouping represents a single value, returns the bit length of this address division series.
IP address examples: 1.2.3.4 returns 32 1.2.*.* returns 16 1.2.*.0/24 returns 16 in the case of PrefixConfiguration == ALL_PREFIXES_ARE_SUBNETS, 32 otherwise 1.2.*.4 returns null 1.2.252-255.* returns 22 1.2.3.4/x returns x in the case of PrefixConfiguration == ALL_PREFIXES_ARE_SUBNETS, 32 otherwise 1.2.0.0/16 returns 16 in the case of PrefixConfiguration == ALL_PREFIXES_ARE_SUBNETS or PREFIXED_ZERO_HOSTS_ARE_SUBNETS, 32 otherwise
getPrefixLengthForSingleBlock in interface AddressItempublic abstract boolean isMulticast()
InetAddress.isMulticastAddress()public BigInteger getCount()
getCount in interface AddressDivisionSeriesgetCount in interface AddressItempublic BigInteger getPrefixCount(int prefixLength)
getPrefixCount in interface AddressDivisionSeriesgetPrefixCount in interface AddressItempublic BigInteger getPrefixCount()
getCount()getPrefixCount in interface AddressDivisionSeriespublic BigInteger getBlockCount(int segmentCount)
AddressDivisionSeriesgetBlockCount in interface AddressDivisionSeriespublic byte[] getBytes()
getBytes in interface AddressItempublic byte[] getBytes(byte[] bytes)
AddressItemgetBytes in interface AddressItempublic byte[] getBytes(byte[] bytes,
int index)
AddressItemgetBytes in interface AddressItempublic byte[] getUpperBytes()
getUpperBytes in interface AddressItempublic byte[] getUpperBytes(byte[] bytes)
AddressItemgetUpperBytes in interface AddressItempublic byte[] getUpperBytes(byte[] bytes,
int index)
AddressItemgetUpperBytes in interface AddressItempublic BigInteger getValue()
AddressItemgetValue in interface AddressItempublic BigInteger getUpperValue()
AddressItemgetUpperValue in interface AddressItempublic boolean isZero()
AddressItemisZero in interface AddressItempublic boolean includesZero()
AddressItemincludesZero in interface AddressItempublic boolean isMax()
AddressItemisMax in interface AddressItempublic boolean includesMax()
AddressItemincludesMax in interface AddressItempublic boolean isFullRange()
AddressItemisFullRange in interface AddressItempublic abstract boolean isLocal()
public boolean isSameAddress(Address other)
public boolean equals(Object o)
public boolean prefixEquals(Address other)
public boolean contains(Address other)
other - public boolean isSequential()
AddressDivisionSeriesGenerally, this means that any division covering a range of values must be followed by divisions that are full range, covering all values.
isSequential in interface AddressDivisionSeriespublic HostIdentifierString toAddressString()
public String toHexString(boolean with0xPrefix) throws IncompatibleAddressException
toHexString in interface AddressComponentIncompatibleAddressExceptionpublic String toNormalizedString()
The string returned by this method is unique for each address.
toNormalizedString in interface AddressComponentpublic String toCanonicalString()
RFC 5952 describes canonical representations for Ipv6 http://en.wikipedia.org/wiki/IPv6_address#Recommended_representation_as_text http://tools.ietf.org/html/rfc5952
Each address has a unique canonical string, not counting the prefix. The prefix can cause two equal addresses to have different strings.
toCanonicalString in interface AddressSegmentSeriespublic String toCompressedString()
toCompressedString in interface AddressSegmentSeriespublic String[] getDivisionStrings()
AddressDivisionSeriesgetDivisionStrings in interface AddressDivisionSeriespublic String[] getSegmentStrings()
AddressSegmentSeriesgetSegmentStrings in interface AddressSegmentSeriespublic abstract Address reverseSegments()
AddressSegmentSeriesIncompatibleAddressException since all address series can reverse their segments.reverseSegments in interface AddressSegmentSeriespublic abstract Address reverseBits(boolean perByte)
AddressSegmentSeriesreverseBits in interface AddressComponentreverseBits in interface AddressSegmentSeriesperByte - if true, only the bits in each byte are reversed, if false, then all bits in the component are reversedpublic abstract Address reverseBytes()
AddressSegmentSeriesreverseBytes in interface AddressComponentreverseBytes in interface AddressSegmentSeriespublic abstract Address reverseBytesPerSegment()
AddressSegmentSeriesreverseBytesPerSegment in interface AddressSegmentSeriespublic boolean isPrefixBlock()
isPrefixBlock in interface AddressDivisionSeriespublic boolean containsPrefixBlock(int prefixLength)
AddressItem
Use AddressItem.getMinPrefixLengthForBlock() to determine the smallest prefix length for which this method returns true.
containsPrefixBlock in interface AddressItempublic boolean isSinglePrefixBlock()
isPrefixBlock() except that it returns false when
the subnet has multiple prefixes.
For instance, 1.*.*.* /16 return false for this method and returns true for isPrefixBlock()isSinglePrefixBlock in interface AddressDivisionSeriespublic boolean containsSinglePrefixBlock(int prefixLength)
AddressItem
Use AddressItem.getPrefixLengthForSingleBlock() to determine whether there is a prefix length for which this method returns true.
containsSinglePrefixBlock in interface AddressItempublic abstract Address toPrefixBlock()
AddressSegmentSeriestoPrefixBlock in interface AddressSegmentSeries@Deprecated public abstract Address removePrefixLength()
AddressSegmentSeries
If the series already has a prefix length, the bits outside the prefix become zero.
Use AddressSegmentSeries.withoutPrefixLength() to remove the prefix length without changing the series values.
Equivalent to calling removePrefixLength(true)
removePrefixLength in interface AddressSegmentSeriesfor an alternative which does not change the address series values.public abstract Address withoutPrefixLength()
AddressSegmentSeries
Use AddressSegmentSeries.removePrefixLength() as an alternative that deletes the host at the same time by zeroing the host values.
withoutPrefixLength in interface AddressSegmentSeries@Deprecated public abstract Address removePrefixLength(boolean zeroed)
AddressSegmentSeriesAddressSegmentSeries.removePrefixLength()removePrefixLength in interface AddressSegmentSerieszeroed - whether the bits outside the prefix become zeropublic abstract Address adjustPrefixBySegment(boolean nextSegment)
AddressSegmentSeries
Follows the same rules as AddressSegmentSeries.adjustPrefixLength(int):
When prefix length is increased, the bits moved within the prefix become zero.
When a prefix length is decreased, the bits moved outside the prefix become zero.
To avoid the zeroing behaviour, use AddressSegmentSeries.adjustPrefixBySegment(boolean, boolean) with second arg false.
adjustPrefixBySegment in interface AddressSegmentSeriesnextSegment - whether to move prefix to previous or following segment boundarypublic abstract Address adjustPrefixBySegment(boolean nextSegment, boolean zeroed)
AddressSegmentSeriesadjustPrefixBySegment in interface AddressSegmentSeriesnextSegment - whether to move prefix to previous or following segment boundaryzeroed - whether the bits that move from one side of the prefix to the other become zero or retain their original valuespublic abstract Address adjustPrefixLength(int adjustment)
AddressSegmentSeries
When prefix length is increased, the bits moved within the prefix become zero.
When the prefix is extended beyond the segment series boundary, it is removed.
When a prefix length is decreased, the bits moved outside the prefix become zero.
To avoid the zeroing behaviour, use AddressSegmentSeries.adjustPrefixLength(int, boolean) with second arg false.
adjustPrefixLength in interface AddressSegmentSeriespublic abstract Address adjustPrefixLength(int adjustment, boolean zeroed)
AddressSegmentSeriesadjustPrefixLength in interface AddressSegmentSeriesadjustment - the incrementzeroed - whether the bits that move from one side of the prefix to the other become zero or retain their original valuespublic abstract Address setPrefixLength(int prefixLength)
AddressSegmentSeries
If this series has a prefix length, and the prefix length is increased, the bits moved within the prefix become zero.
For an alternative that does not set bits to zero, use AddressSegmentSeries.setPrefixLength(int, boolean) with the second argument as false.
When the prefix is extended beyond the segment series boundary, it is removed.
The bits that move from one side of the prefix length to the other (ie bits moved into the prefix or outside the prefix) are zeroed.
setPrefixLength in interface AddressSegmentSeriespublic abstract Address setPrefixLength(int prefixLength, boolean zeroed)
AddressSegmentSeriesWhen the prefix is extended beyond the segment series boundary, it is removed.
setPrefixLength in interface AddressSegmentSerieszeroed - whether the bits that move from one side of the prefix length to the other (ie bits moved into the prefix or outside the prefix) are zeroed.@Deprecated public abstract Address applyPrefixLength(int networkPrefixLength)
AddressSegmentSeries
Similar to AddressSegmentSeries.setPrefixLength(int) except that prefix lengths are never increased.
When this series already has a prefix length that is less than or equal to the requested prefix length, this series is returned.
Otherwise the returned series has the given prefix length.
The bits moved outside the prefix will become zero in the returned series.
applyPrefixLength in interface AddressSegmentSeriesAddressSegmentSeries.setPrefixLength(int)public static boolean matchUnordered(Address[] addrs1, Address[] addrs2)
addrs1 - addrs2 - public static boolean matchOrdered(Address[] addrs1, Address[] addrs2)
addrs1 - addrs2 -