public interface AddressSegment extends AddressComponent, java.lang.Comparable<AddressDivision>
AddressDivision
interface instead.
Divisions do not have the restriction that divisions of an address are equal length and a whole number of bytes.
Divisions can be grouped using AddressDivisionGrouping
.
AddressSegment objects are immutable and thus also thread-safe.Modifier and Type | Method and Description |
---|---|
boolean |
contains(AddressSegment other) |
boolean |
equals(java.lang.Object other) |
java.lang.Iterable<? extends AddressSegment> |
getIterable()
Useful for using an instance in a "for-each loop".
|
AddressSegment |
getLower()
If this segment represents a range of values, returns a segment representing just the lowest value in the range, otherwise returns this.
|
int |
getLowerSegmentValue()
returns the lower value
|
int |
getMaxSegmentValue()
Gets the maximum possible value for this type of segment (for the highest range value of this particular segment, use
getUpper() |
AddressSegment |
getUpper()
If this segment represents a range of values, returns a segment representing just the highest value in the range, otherwise returns this.
|
int |
getUpperSegmentValue()
returns the upper value
|
int |
getValueCount() |
java.util.Iterator<? extends AddressSegment> |
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.
|
boolean |
matches(int value) |
boolean |
matchesWithMask(int value,
int mask) |
AddressSegment |
reverseBits(boolean perByte)
Returns a new AddressComponent with the bits reversed.
|
AddressSegment |
reverseBytes()
Returns an AddressComponent with the bytes reversed.
|
getByteCount, toHexString, toNormalizedString
getBitCount, getBytes, getBytes, getCount, getUpperBytes, getUpperBytes, isFullRange, isMultiple, isZero
int getValueCount()
AddressItem.getCount()
int getLowerSegmentValue()
int getUpperSegmentValue()
AddressSegment getLower()
getLower
in interface AddressComponent
AddressSegment getUpper()
getUpper
in interface AddressComponent
AddressSegment reverseBits(boolean perByte)
AddressComponent
reverseBits
in interface AddressComponent
perByte
- if true, only the bits in each byte are reversed, if false, then all bits in the component are reversedAddressSegment reverseBytes()
AddressComponent
reverseBytes
in interface AddressComponent
java.lang.Iterable<? extends AddressSegment> getIterable()
AddressComponent
AddressComponent.iterator()
directly.getIterable
in interface AddressComponent
java.util.Iterator<? extends AddressSegment> iterator()
AddressComponent
AddressItem.isMultiple()
to determine if this instance represents multiple.
This method iterates through the individual elements.iterator
in interface AddressComponent
boolean matches(int value)
boolean matchesWithMask(int value, int mask)
boolean contains(AddressSegment other)
boolean equals(java.lang.Object other)
equals
in class java.lang.Object
int getMaxSegmentValue()
getUpper()