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, toNormalizedStringgetBitCount, getBytes, getBytes, getCount, getUpperBytes, getUpperBytes, isFullRange, isMultiple, isZeroint getValueCount()
AddressItem.getCount()int getLowerSegmentValue()
int getUpperSegmentValue()
AddressSegment getLower()
getLower in interface AddressComponentAddressSegment getUpper()
getUpper in interface AddressComponentAddressSegment reverseBits(boolean perByte)
AddressComponentreverseBits in interface AddressComponentperByte - if true, only the bits in each byte are reversed, if false, then all bits in the component are reversedAddressSegment reverseBytes()
AddressComponentreverseBytes in interface AddressComponentjava.lang.Iterable<? extends AddressSegment> getIterable()
AddressComponentAddressComponent.iterator() directly.getIterable in interface AddressComponentjava.util.Iterator<? extends AddressSegment> iterator()
AddressComponentAddressItem.isMultiple() to determine if this instance represents multiple.
This method iterates through the individual elements.iterator in interface AddressComponentboolean matches(int value)
boolean matchesWithMask(int value,
int mask)
boolean contains(AddressSegment other)
boolean equals(java.lang.Object other)
equals in class java.lang.Objectint getMaxSegmentValue()
getUpper()