public interface IPAddressRange extends IPAddressAggregation<IPAddress,IPAddressSeqRange>, AddressComponentRange
| Modifier and Type | Method and Description |
|---|---|
IPAddressRange[] |
complement()
Returns the complement of the address range within the address space.
|
BigInteger |
enumerate(IPAddress other)
Indicates where an address sits relative to the range ordering.
|
default BigInteger |
getCount()
Returns the number of individual addresses in this range.
|
Iterable<? extends IPAddress> |
getIterable()
Useful for using an instance in a "for-each loop", as in
for(addr : address.getIterable()) { ... |
IPAddressContainmentTrieBase<? extends IPAddress,? extends IPAddressSeqRange> |
intoContainmentTrie()
Creates a containment trie from the address, which will contain the same set of individual addresses as this range of addresses.
|
IPAddressSeqRangeList |
intoSequentialRangeList()
Creates a sequential range list from the address, which will contain the same set of individual addresses as this range of addresses.
|
boolean |
isMultiple()
Returns true if there is more than one address in this range.
|
Iterator<? extends IPAddress> |
prefixBlockIterator(int prefLength)
Iterates through the range of prefix blocks in this range instance using the given prefix length.
|
AddressComponentRangeSpliterator<? extends IPAddressRange,? extends IPAddress> |
prefixBlockSpliterator(int prefLength)
Partitions and traverses through the individual prefix blocks for the given prefix length.
|
Stream<? extends IPAddress> |
prefixBlockStream(int prefLength)
Returns a sequential stream of the prefix blocks for the given prefix length.
|
Iterator<? extends IPAddressRange> |
prefixIterator(int prefixLength)
Iterates through the range of prefixes in this range instance using the given prefix length.
|
AddressComponentSpliterator<? extends IPAddressRange> |
prefixSpliterator(int prefLength)
Partitions and traverses through the individual prefixes for the given prefix length.
|
Stream<? extends IPAddressRange> |
prefixStream(int prefLength)
Returns a sequential stream of the individual prefixes for the given prefix length.
|
IPAddress[] |
spanWithPrefixBlocks()
Produces a minimal array of prefix blocks that spans the same set of addresses.
|
IPAddress[] |
spanWithSequentialBlocks()
Produces a minimal array of blocks that are sequential that cover the same set of addresses.
|
AddressComponentRangeSpliterator<? extends IPAddressRange,? extends IPAddress> |
spliterator()
Partitions and traverses through the individual addresses.
|
String |
toCanonicalString()
Produces a string that is unique and uses the canonical representation for all instances.
|
String |
toNormalizedString()
Produces a string that is unique and consistent for all instances.
|
IPAddressSeqRange |
toSequentialRange()
Deprecated.
renamed to coverWithSequentialRange to reflect the fact that the returned range does not always represent the same set of addresses
|
contains, contains, coverWithPrefixBlock, coverWithSequentialRange, getLower, getUpper, includesMax, includesZero, isSequential, iterator, overlaps, overlaps, streamgetLower, getUpper, iterator, stream, stream, streamcompareTo, containsPrefixBlock, containsSinglePrefixBlock, getBitCount, getBitsForCount, getBlockSize, getByteCount, getBytes, getBytes, getBytes, getMinPrefixLengthForBlock, getPrefixCount, getPrefixLengthForSingleBlock, getUpperBytes, getUpperBytes, getUpperBytes, getUpperValue, getValue, includesMax, includesZero, isFullRange, isMax, isZerodefault BigInteger getCount()
getCount in interface AddressItemgetCount in interface IPAddressAggregation<IPAddress,IPAddressSeqRange>boolean isMultiple()
isMultiple in interface AddressItemisMultiple in interface IPAddressAggregation<IPAddress,IPAddressSeqRange>BigInteger enumerate(IPAddress other)
Determines how many address elements of a range precede the given address element, if the address is in the range. If above the range, it is the distance to the upper boundary added to the range count less one, and if below the range, the distance to the lower boundary.
In other words, if the given address is not in the range but above it, returns the number of addresses preceding the address from the upper range boundary, added to one less than the total number of range addresses. If the given address is not in the subnet but below it, returns the number of addresses following the address to the lower subnet boundary.
Returns null when the argument is multi-valued. The argument must be an individual address.
When this is also an individual address, the returned value is the distance (difference) between the two address values.
If the given address does not have the same version or type, then null is returned.
other - Iterable<? extends IPAddress> getIterable()
for(addr : address.getIterable()) { ... }
Otherwise just call IPAddressAggregation.iterator() directly.
getIterable in interface AddressComponentRangeAddressComponentRangeSpliterator<? extends IPAddressRange,? extends IPAddress> spliterator()
spliterator in interface AddressComponentRangespliterator in interface IPAddressAggregation<IPAddress,IPAddressSeqRange>Iterator<? extends IPAddress> prefixBlockIterator(int prefLength)
prefLength - AddressComponentRangeSpliterator<? extends IPAddressRange,? extends IPAddress> prefixBlockSpliterator(int prefLength)
Stream<? extends IPAddress> prefixBlockStream(int prefLength)
BaseStream.parallel() on the returned stream.Iterator<? extends IPAddressRange> prefixIterator(int prefixLength)
prefixLength - AddressComponentSpliterator<? extends IPAddressRange> prefixSpliterator(int prefLength)
Stream<? extends IPAddressRange> prefixStream(int prefLength)
BaseStream.parallel() on the returned stream.IPAddress[] spanWithPrefixBlocks()
IPAddress[] spanWithSequentialBlocks()
spanWithPrefixBlocks() and is never longer.@Deprecated IPAddressSeqRange toSequentialRange()
IPAddressSeqRangeList intoSequentialRangeList()
Unlike IPAddressAggregation.coverWithSequentialRange(), the returned list will always contain the same set of addresses as this range, regardless of whether this range of addresses is sequential or not.
IPAddressContainmentTrieBase<? extends IPAddress,? extends IPAddressSeqRange> intoContainmentTrie()
While the trie will contain blocks that will differ from this address if this address is not a prefix block or individual address, the returned trie will always contain the same set of individual addresses as this range, regardless of whether this range of addresses is sequential or not.
IPAddressRange[] complement()
Returns a minimal array of IP address sequential ranges instances containing the addresses not contained within this address range.
String toNormalizedString()
String toCanonicalString()