public interface AddressSegmentSeries extends AddressDivisionSeries, AddressComponent
Modifier and Type | Method and Description |
---|---|
AddressSegmentSeries |
adjustPrefixBySegment(boolean nextSegment)
Increases or decreases prefix length to the next segment boundary.
|
AddressSegmentSeries |
adjustPrefixLength(int adjustment)
Increases or decreases prefix length by the given increment.
|
AddressSegmentSeries |
applyPrefixLength(int networkPrefixLength)
Applies the given prefix length to create a new segment series representing all segment series starting with the same prefix.
|
int |
getBitsPerSegment() |
int |
getBytesPerSegment() |
java.lang.Iterable<? extends AddressSegmentSeries> |
getIterable()
Useful for using an instance in a "for-each loop".
|
AddressSegmentSeries |
getLower()
If this instance represents multiple address components, returns the one with the lowest numeric value.
|
AddressSection |
getSection(int index)
Gets the subsection from the series starting from the given index
|
AddressSection |
getSection(int index,
int endIndex)
Gets the subsection from the series starting from the given index and ending just before the give endIndex
|
AddressSegment |
getSegment(int index) |
int |
getSegmentCount() |
AddressSegment[] |
getSegments() |
void |
getSegments(AddressSegment[] segs) |
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 the given index
|
AddressSegmentSeries |
getUpper()
If this instance represents multiple address components, returns the one with the highest numeric value.
|
java.util.Iterator<? extends AddressSegmentSeries> |
iterator()
An address component can represent a single segment, address, or section, or it can represent multiple,
typically a subnet or range of segment, address, or section values.
|
AddressSegmentSeries |
removePrefixLength()
Removes the prefix.
|
AddressSegmentSeries |
reverseBits(boolean perByte)
Returns a new segment series with the bits reversed.
|
AddressSegmentSeries |
reverseBytes()
Returns a new segment series with the bytes reversed.
|
AddressSegmentSeries |
reverseBytesPerSegment()
Returns a new segment series with the bytes reversed within each segment.
|
AddressSegmentSeries |
reverseSegments()
Returns a new segment series with the segments reversed.
|
java.util.Iterator<? extends AddressSegment[]> |
segmentsIterator() |
AddressSegmentSeries |
setPrefixLength(int prefixLength)
Sets the prefix length.
|
java.lang.String |
toCanonicalString()
Produces the canonical representation of the address
|
java.lang.String |
toCompressedString()
Produces a short representation of the address while remaining within the confines of standard representation(s) of the address
|
getDivision, getEquivalentPrefix, getMinPrefix, getPrefixLength, isMore, isMultipleByPrefix, isPrefixed, isRangeEquivalentToPrefix
getDivisionCount
getByteCount, toHexString, toNormalizedString
getBitCount, getBytes, getBytes, getCount, getUpperBytes, getUpperBytes, isFullRange, isMultiple, isZero
int getSegmentCount()
int getBitsPerSegment()
int getBytesPerSegment()
AddressSection getSection(int index)
index
- java.lang.IndexOutOfBoundsException
- if index < 0AddressSection getSection(int index, int endIndex)
index
- endIndex
- java.lang.IndexOutOfBoundsException
- if index < 0 or endIndex extends beyond the end of the seriesAddressSegment getSegment(int index)
void getSegments(AddressSegment[] segs)
void getSegments(int start, int end, AddressSegment[] segs, int index)
start
- end
- segs
- index
- AddressSegment[] getSegments()
AddressSegmentSeries getLower()
AddressComponent
getLower
in interface AddressComponent
AddressSegmentSeries getUpper()
AddressComponent
getUpper
in interface AddressComponent
java.lang.Iterable<? extends AddressSegmentSeries> getIterable()
AddressComponent
AddressComponent.iterator()
directly.getIterable
in interface AddressComponent
java.util.Iterator<? extends AddressSegmentSeries> iterator()
AddressComponent
AddressItem.isMultiple()
to determine if this instance represents multiple.
This method iterates through the individual elements.iterator
in interface AddressComponent
java.util.Iterator<? extends AddressSegment[]> segmentsIterator()
java.lang.String toCanonicalString()
java.lang.String toCompressedString()
AddressSegmentSeries reverseSegments()
AddressSegmentSeries reverseBits(boolean perByte)
reverseBits
in interface AddressComponent
perByte
- if true, only the bits in each byte are reversed, if false, then all bits in the component are reversedAddressTypeException
- if reversing the bits within a single segment cannot be done
because the segment represents a range, and when all values in that range are reversed, the result is not contiguous.
In practice this means that to be reversible the range must include all values except possibly the largest and/or smallest.AddressSegmentSeries reverseBytes()
reverseBytes
in interface AddressComponent
AddressTypeException
- if the segments have more than 1 bytes,
and if reversing the bits within a single segment cannot be done because the segment represents a range that is not the entire segment range.AddressSegmentSeries reverseBytesPerSegment()
AddressTypeException
- if the segments have more than 1 bytes,
and if reversing the bits within a single segment cannot be done because the segment represents a range that is not the entire segment range.AddressSegmentSeries removePrefixLength()
nextSegment
- AddressSegmentSeries adjustPrefixBySegment(boolean nextSegment)
nextSegment
- AddressSegmentSeries adjustPrefixLength(int adjustment)
nextSegment
- AddressSegmentSeries setPrefixLength(int prefixLength)
nextSegment
- AddressSegmentSeries applyPrefixLength(int networkPrefixLength)