public interface AddressSection extends AddressSegmentSeries
| Modifier and Type | Method and Description |
|---|---|
AddressSection |
adjustPrefixBySegment(boolean nextSegment)
Increases or decreases prefix length to the next segment boundary.
|
AddressSection |
adjustPrefixBySegment(boolean nextSegment,
boolean zeroed)
Increases or decreases prefix length to the next segment boundary.
|
AddressSection |
adjustPrefixLength(int adjustment)
Increases or decreases prefix length by the given increment.
|
AddressSection |
adjustPrefixLength(int adjustment,
boolean zeroed)
Increases or decreases prefix length by the given increment.
|
AddressSection |
applyPrefixLength(int networkPrefixLength)
Deprecated.
|
boolean |
contains(AddressSection other)
Determines if one section contains another.
|
Iterable<? extends AddressSection> |
getIterable()
Useful for using an instance in a "for-each loop".
|
AddressSection |
getLower()
If this represents a series with ranging values, returns a series representing the lower values of the range.
|
AddressSection |
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.
|
AddressSection |
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.
|
AddressSection |
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. |
Iterator<? extends AddressSection> |
iterator()
Iterates through the individual address components.
|
Iterator<? extends AddressSection> |
prefixBlockIterator()
Iterates through the individual prefix blocks.
|
AddressComponentSpliterator<? extends AddressSection> |
prefixBlockSpliterator()
Partitions and traverses through the individual prefix blocks for the prefix length of this series.
|
Stream<? extends AddressSection> |
prefixBlockStream()
Returns a sequential stream of the individual prefix blocks for the prefix length of this series.
|
boolean |
prefixEquals(AddressSection other)
Determines if the argument section matches this section up to the prefix length of this section.
|
Iterator<? extends AddressSection> |
prefixIterator()
Iterates through the individual prefixes.
|
AddressComponentSpliterator<? extends AddressSection> |
prefixSpliterator()
Partitions and traverses through the individual prefixes for the prefix length of this series.
|
Stream<? extends AddressSection> |
prefixStream()
Returns a sequential stream of the individual prefixes for the prefix length of this series.
|
AddressSection |
removePrefixLength()
Deprecated.
|
AddressSection |
removePrefixLength(boolean zeroed)
Deprecated.
|
AddressSection |
reverseBits(boolean perByte)
Returns a new segment series with the bits reversed.
|
AddressSection |
reverseBytes()
Returns a new segment series with the bytes reversed.
|
AddressSection |
reverseBytesPerSegment()
Returns a new segment series with the bytes reversed within each segment.
|
AddressSection |
reverseSegments()
Returns a new segment series with the segments reversed.
|
AddressSection |
setPrefixLength(int prefixLength)
Sets the prefix length.
|
AddressSection |
setPrefixLength(int prefixLength,
boolean zeroed)
Sets the prefix length.
|
AddressComponentSpliterator<? extends AddressSection> |
spliterator()
Partitions and traverses through the individual address components.
|
Stream<? extends AddressSection> |
stream()
Returns a sequential stream of the individual address components.
|
AddressSection |
toPrefixBlock()
If this series has a prefix length, returns the block for that prefix.
|
AddressSection |
withoutPrefixLength()
Provides the same address with no prefix.
|
getBitsPerSegment, getBytesPerSegment, getMaxSegmentValue, getSection, getSection, getSection, getSegment, getSegmentCount, getSegments, getSegments, getSegments, getSegmentStrings, isOneBit, segmentsIterator, segmentsSpliterator, segmentsStream, testBit, toCanonicalString, toCompressedStringgetBitCount, getBlockCount, getCount, getDivision, getDivisionStrings, getPrefixCount, getPrefixCount, getPrefixLength, getSequentialBlockIndex, isMore, isPrefixBlock, isPrefixed, isSequential, isSinglePrefixBlockgetDivisionCountgetNetwork, toHexString, toNormalizedStringstream, streamcompareTo, containsPrefixBlock, containsSinglePrefixBlock, getByteCount, getBytes, getBytes, getBytes, getMinPrefixLengthForBlock, getPrefixLengthForSingleBlock, getUpperBytes, getUpperBytes, getUpperBytes, getUpperValue, getValue, includesMax, includesZero, isFullRange, isMax, isMultiple, isZeroboolean contains(AddressSection other)
Sections must have the same number of segments to be comparable.
For sections which are aware of their position in an address (IPv6 and MAC), their respective positions must match to be comparable.
other - boolean prefixEquals(AddressSection other)
The entire prefix of this section must be present in the other section to be comparable.
For sections which are aware of their position in an address (IPv6 and MAC), the argument section must have the same or an earlier position in the address to match all prefix segments of this section, and the matching is lined up relative to the position.
other - AddressSection getLower()
AddressSegmentSeriesgetLower in interface AddressComponentRangegetLower in interface AddressSegmentSeriesAddressSection getUpper()
AddressSegmentSeriesgetUpper in interface AddressComponentRangegetUpper in interface AddressSegmentSeriesAddressSection reverseSegments()
AddressSegmentSeriesIncompatibleAddressException since all address series can reverse their segments.reverseSegments in interface AddressSegmentSeriesAddressSection 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 reversedAddressSection reverseBytes()
AddressSegmentSeriesreverseBytes in interface AddressComponentreverseBytes in interface AddressSegmentSeriesAddressSection reverseBytesPerSegment()
AddressSegmentSeriesreverseBytesPerSegment in interface AddressSegmentSeriesAddressSection toPrefixBlock()
AddressSegmentSeriestoPrefixBlock in interface AddressSegmentSeries@Deprecated AddressSection 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.AddressSection 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 AddressSection removePrefixLength(boolean zeroed)
AddressSegmentSeriesAddressSegmentSeries.removePrefixLength()removePrefixLength in interface AddressSegmentSerieszeroed - whether the bits outside the prefix become zeroAddressSection 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 boundaryAddressSection 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 valuesAddressSection 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 AddressSegmentSeriesAddressSection 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 valuesAddressSection 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 AddressSegmentSeriesAddressSection 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 AddressSection 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)Iterable<? extends AddressSection> getIterable()
AddressComponentRangeAddressComponentRange.iterator() directly.getIterable in interface AddressComponentRangegetIterable in interface AddressSegmentSeriesIterator<? extends AddressSection> 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 AddressComponentRangeiterator in interface AddressSegmentSeriesAddressComponentSpliterator<? extends AddressSection> spliterator()
AddressComponentRangespliterator in interface AddressComponentspliterator in interface AddressComponentRangespliterator in interface AddressSegmentSeriesStream<? extends AddressSection> stream()
AddressComponentRangeBaseStream.parallel() on the returned stream.stream in interface AddressComponentRangestream in interface AddressSegmentSeriesIterator<? extends AddressSection> prefixIterator()
AddressSegmentSeries
If the series has no prefix length, then this is equivalent to AddressSegmentSeries.iterator()
prefixIterator in interface AddressSegmentSeriesAddressComponentSpliterator<? extends AddressSection> prefixSpliterator()
AddressSegmentSeriesprefixSpliterator in interface AddressSegmentSeriesStream<? extends AddressSection> prefixStream()
AddressSegmentSeriesBaseStream.parallel() on the returned stream.prefixStream in interface AddressSegmentSeriesIterator<? extends AddressSection> prefixBlockIterator()
AddressSegmentSeries
If the series has no prefix length, then this is equivalent to AddressSegmentSeries.iterator()
prefixBlockIterator in interface AddressSegmentSeriesAddressComponentSpliterator<? extends AddressSection> prefixBlockSpliterator()
AddressSegmentSeriesprefixBlockSpliterator in interface AddressSegmentSeriesStream<? extends AddressSection> prefixBlockStream()
AddressSegmentSeriesBaseStream.parallel() on the returned stream.prefixBlockStream in interface AddressSegmentSeriesAddressSection increment(long increment)
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 AddressSegmentSeriesAddressSection incrementBoundary(long increment)
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 AddressSegmentSeries