public class IPv6AddressSeqRange extends IPAddressSeqRange implements Iterable<IPv6Address>
IPAddressSeqRange
for more details.
DEFAULT_RANGE_SEPARATOR
Constructor and Description |
---|
IPv6AddressSeqRange(IPv6Address first,
IPv6Address second) |
Modifier and Type | Method and Description |
---|---|
IPv6Address |
coverWithPrefixBlock()
Returns the minimal-size prefix block that covers all the addresses in this range.
|
Iterable<IPv6Address> |
getIterable()
Useful for using an instance in a "for-each loop", as in
for(addr : address.getIterable()) { ... |
IPv6Address |
getLower()
Returns the lowest address in the sequential range, the one with the lowest numeric value
|
IPv6Address |
getUpper()
Returns the highest address in the sequential range, the one with the highest numeric value
|
IPv6AddressSeqRange |
intersect(IPAddressSeqRange other)
Returns the intersection of this range with the given range, a range which includes those addresses in both this and the given range.
|
Iterator<IPv6Address> |
iterator()
Iterates through the individual addresses of this address or subnet.
|
IPv6AddressSeqRange |
join(IPAddressSeqRange other)
Joins two ranges if they are contiguous ranges.
|
Iterator<IPv6Address> |
prefixBlockIterator(int prefLength)
Iterates through the range of prefix blocks in this range instance using the given prefix length.
|
AddressComponentRangeSpliterator<IPv6AddressSeqRange,IPv6Address> |
prefixBlockSpliterator(int prefLength)
Partitions and traverses through the individual prefix blocks for the given prefix length.
|
Stream<IPv6Address> |
prefixBlockStream(int prefLength)
Returns a sequential stream of the prefix blocks for the given prefix length.
|
Iterator<IPv6AddressSeqRange> |
prefixIterator(int prefixLength)
Iterates through the range of prefixes in this range instance using the given prefix length.
|
AddressComponentSpliterator<IPv6AddressSeqRange> |
prefixSpliterator(int prefLength)
Partitions and traverses through the individual prefixes for the given prefix length.
|
Stream<IPv6AddressSeqRange> |
prefixStream(int prefLength)
Returns a sequential stream of the individual prefixes for the given prefix length.
|
IPv6Address[] |
spanWithPrefixBlocks()
Produces an array of prefix blocks that spans the same set of addresses.
|
IPv6Address[] |
spanWithSequentialBlocks()
Produces an array of blocks that are sequential that cover the same set of addresses.
|
AddressComponentRangeSpliterator<IPv6AddressSeqRange,IPv6Address> |
spliterator()
Partitions and traverses through the individual addresses.
|
Stream<IPv6Address> |
stream()
Returns a sequential stream of the individual address components.
|
IPv6AddressSeqRange[] |
subtract(IPAddressSeqRange other)
Subtracts the given range from this range, to produce either zero, one, or two address ranges that contain the addresses in this range and not in the given range.
|
String |
toIPv6String(Function<IPv6Address,String> lowerStringer,
String separator,
Function<IPv6Address,String> upperStringer) |
IPv6AddressSeqRange |
toSequentialRange()
Converts to a sequential range from the lowest and highest addresses in this range, returns "this" if one already
|
contains, contains, containsPrefixBlock, containsSinglePrefixBlock, enumerate, equals, extend, getBitCount, getBytes, getBytes, getBytes, getCount, getUpperBytes, getUpperBytes, getUpperBytes, getUpperValue, getValue, hashCode, includesMax, includesZero, isMax, isMore, isMultiple, isSequential, isZero, join, overlaps, overlaps, toCanonicalString, toCanonicalString, toNormalizedString, toNormalizedString, toString, toString
stream, stream
compareTo, getBitsForCount, getBlockSize, getByteCount, getMinPrefixLengthForBlock, getPrefixCount, getPrefixLengthForSingleBlock, isFullRange
public IPv6AddressSeqRange(IPv6Address first, IPv6Address second)
public IPv6Address getLower()
IPAddressSeqRange
getLower
in interface AddressComponentRange
getLower
in interface IPAddressRange
getLower
in class IPAddressSeqRange
public IPv6Address getUpper()
IPAddressSeqRange
getUpper
in interface AddressComponentRange
getUpper
in interface IPAddressRange
getUpper
in class IPAddressSeqRange
public Iterable<IPv6Address> getIterable()
IPAddressRange
for(addr : address.getIterable()) { ... }
Otherwise just call IPAddressRange.iterator()
directly.
getIterable
in interface AddressComponentRange
getIterable
in interface IPAddressRange
getIterable
in class IPAddressSeqRange
public Iterator<IPv6Address> iterator()
IPAddressRange
Call AddressItem.isMultiple()
to determine if this instance represents multiple, or AddressItem.getCount()
for the count.
iterator
in interface AddressComponentRange
iterator
in interface IPAddressRange
iterator
in interface Iterable<IPv6Address>
iterator
in class IPAddressSeqRange
public AddressComponentRangeSpliterator<IPv6AddressSeqRange,IPv6Address> spliterator()
IPAddressRange
spliterator
in interface AddressComponentRange
spliterator
in interface IPAddressRange
spliterator
in interface Iterable<IPv6Address>
spliterator
in class IPAddressSeqRange
public Stream<IPv6Address> stream()
AddressComponentRange
BaseStream.parallel()
on the returned stream.stream
in interface AddressComponentRange
stream
in class IPAddressSeqRange
public IPv6Address coverWithPrefixBlock()
IPAddressSeqRange
coverWithPrefixBlock
in interface IPAddressRange
coverWithPrefixBlock
in class IPAddressSeqRange
public IPv6Address[] spanWithPrefixBlocks()
IPAddressRange
spanWithPrefixBlocks
in interface IPAddressRange
spanWithPrefixBlocks
in class IPAddressSeqRange
public IPv6Address[] spanWithSequentialBlocks()
IPAddressRange
IPAddressRange.spanWithPrefixBlocks()
and is never longer.spanWithSequentialBlocks
in interface IPAddressRange
spanWithSequentialBlocks
in class IPAddressSeqRange
public Iterator<IPv6Address> prefixBlockIterator(int prefLength)
IPAddressSeqRange
prefixBlockIterator
in interface IPAddressRange
prefixBlockIterator
in class IPAddressSeqRange
public AddressComponentRangeSpliterator<IPv6AddressSeqRange,IPv6Address> prefixBlockSpliterator(int prefLength)
IPAddressRange
prefixBlockSpliterator
in interface IPAddressRange
prefixBlockSpliterator
in class IPAddressSeqRange
public Stream<IPv6Address> prefixBlockStream(int prefLength)
IPAddressRange
BaseStream.parallel()
on the returned stream.prefixBlockStream
in interface IPAddressRange
prefixBlockStream
in class IPAddressSeqRange
public Iterator<IPv6AddressSeqRange> prefixIterator(int prefixLength)
IPAddressSeqRange
Since a range between two arbitrary addresses cannot always be represented with a single IPAddress instance,
the returned iterator iterates through IPAddressSeqRange
instances.
For instance, if iterating from 1.2.3.4 to 1.2.4.5 with prefix 8, the range shares the same prefix 1, but the range cannot be represented by the address 1.2.3-4.4-5 which does not include 1.2.3.255 or 1.2.4.0 both of which are in the original range. Nor can the range be represented by 1.2.3-4.0-255 which includes 1.2.4.6 and 1.2.3.3, both of which were not in the original range. An IPAddressSeqRange is thus required to represent that prefixed range.
prefixIterator
in interface IPAddressRange
prefixIterator
in class IPAddressSeqRange
public AddressComponentSpliterator<IPv6AddressSeqRange> prefixSpliterator(int prefLength)
IPAddressRange
prefixSpliterator
in interface IPAddressRange
prefixSpliterator
in class IPAddressSeqRange
public Stream<IPv6AddressSeqRange> prefixStream(int prefLength)
IPAddressRange
BaseStream.parallel()
on the returned stream.prefixStream
in interface IPAddressRange
prefixStream
in class IPAddressSeqRange
public String toIPv6String(Function<IPv6Address,String> lowerStringer, String separator, Function<IPv6Address,String> upperStringer)
public IPv6AddressSeqRange intersect(IPAddressSeqRange other)
IPAddressSeqRange
intersect
in class IPAddressSeqRange
public IPv6AddressSeqRange join(IPAddressSeqRange other)
IPAddressSeqRange
Otherwise, null is returned.
join
in class IPAddressSeqRange
public IPv6AddressSeqRange[] subtract(IPAddressSeqRange other)
IPAddressSeqRange
subtract
in class IPAddressSeqRange
public IPv6AddressSeqRange toSequentialRange()
IPAddressRange
The result will represent the same set of addresses if and only if IPAddressRange.isSequential()
is true
toSequentialRange
in interface IPAddressRange