public class MACAddressSegment extends AddressDivision implements AddressSegment, java.lang.Iterable<MACAddressSegment>
| Modifier and Type | Field and Description |
|---|---|
static MACAddressSegment |
ALL_RANGE_SEGMENT |
static MACAddressSegment |
FE_SEGMENT |
static MACAddressSegment |
FF_SEGMENT |
static int |
MAX_CHARS |
static MACAddressSegment |
ZERO_SEGMENT |
| Constructor and Description |
|---|
MACAddressSegment(int value)
Constructs a segment of an IPv4 or IPv6 address with the given value.
|
MACAddressSegment(int lower,
int upper)
Constructs a segment of a MAC address that represents a range of values.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(AddressSegment other) |
boolean |
contains(MACAddressSegment other) |
boolean |
equals(java.lang.Object other) |
int |
getBitCount() |
int |
getByteCount()
returns the number of bytes in each of the address components represented by this instance
|
int |
getDefaultTextualRadix() |
long |
getDivisionValueCount() |
java.lang.Iterable<MACAddressSegment> |
getIterable()
Useful for using an instance in a "for-each loop".
|
MACAddressSegment |
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
|
long |
getLowerValue() |
int |
getMaxDigitCount() |
int |
getMaxSegmentValue()
Gets the maximum possible value for this type of segment (for the highest range value of this particular segment, use
AddressSegment.getUpper() |
long |
getMaxValue() |
MACAddressSegment |
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
|
long |
getUpperValue() |
int |
getValueCount() |
int |
hashCode() |
boolean |
isBoundedBy(int value)
Returns true if the possible values of this division fall below the given value.
|
boolean |
isFullRange() |
java.util.Iterator<MACAddressSegment> |
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) |
MACAddressSegment |
reverseBits() |
MACAddressSegment |
reverseBits(boolean perByte)
Returns a new AddressComponent with the bits reversed.
|
MACAddressSegment |
reverseBytes()
Returns an AddressComponent with the bytes reversed.
|
java.lang.String |
toHexString(boolean with0xPrefix)
Writes this address component as a single hexadecimal value with always the exact same number of characters, with or without a preceding 0x prefix.
|
java.lang.String |
toNormalizedString()
Produces a string that is somewhat similar for all address components of the same type.
|
java.lang.String |
toNormalizedString(AddressDivisionGrouping.StringOptions options) |
compareTo, getCount, getDigitCount, getMaxDigitCount, hasUppercaseVariations, isMultiple, isZero, matches, matchesWithMaskgetBytes, getBytes, getConfiguredString, getDigitCount, getPrefixAdjustedString, getStandardString, getString, getUpperBytes, getUpperBytes, toStringgetBytes, getBytes, getCount, getUpperBytes, getUpperBytes, isMultiple, isZeropublic static final MACAddressSegment ALL_RANGE_SEGMENT
public static final MACAddressSegment FF_SEGMENT
public static final MACAddressSegment FE_SEGMENT
public static final MACAddressSegment ZERO_SEGMENT
public static final int MAX_CHARS
public MACAddressSegment(int value)
value - the value of the segmentpublic MACAddressSegment(int lower,
int upper)
lower - the lower value of the range of values represented by the segment.upper - the upper value of the range of values represented by the segment.public int getValueCount()
getValueCount in interface AddressSegmentAddressItem.getCount()public long getDivisionValueCount()
getDivisionValueCount in class AddressDivisionpublic int getBitCount()
getBitCount in interface AddressItempublic int getByteCount()
AddressComponentgetByteCount in interface AddressComponentpublic long getMaxValue()
getMaxValue in class AddressDivisionpublic long getLowerValue()
getLowerValue in class AddressDivisionpublic long getUpperValue()
getUpperValue in class AddressDivisionpublic int getLowerSegmentValue()
getLowerSegmentValue in interface AddressSegmentpublic int getUpperSegmentValue()
getUpperSegmentValue in interface AddressSegmentpublic MACAddressSegment getLower()
AddressSegmentgetLower in interface AddressComponentgetLower in interface AddressSegmentpublic MACAddressSegment getUpper()
AddressSegmentgetUpper in interface AddressComponentgetUpper in interface AddressSegmentpublic MACAddressSegment reverseBits(boolean perByte)
AddressComponentreverseBits in interface AddressComponentreverseBits in interface AddressSegmentperByte - if true, only the bits in each byte are reversed, if false, then all bits in the component are reversedpublic MACAddressSegment reverseBits()
public MACAddressSegment reverseBytes()
AddressComponentreverseBytes in interface AddressComponentreverseBytes in interface AddressSegmentpublic boolean isBoundedBy(int value)
AddressDivisionisBoundedBy in interface AddressStringDivisionisBoundedBy in class AddressDivisionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in interface AddressSegmentequals in class java.lang.Objectpublic boolean contains(MACAddressSegment other)
other - public boolean isFullRange()
isFullRange in interface AddressItemisFullRange in class AddressDivisionpublic int getDefaultTextualRadix()
getDefaultTextualRadix in class AddressDivisionBasepublic int getMaxDigitCount()
getMaxDigitCount in class AddressDivisionBasepublic boolean matches(int value)
matches in interface AddressSegmentpublic boolean matchesWithMask(int value,
int mask)
matchesWithMask in interface AddressSegmentpublic java.lang.Iterable<MACAddressSegment> getIterable()
AddressComponentAddressComponent.iterator() directly.getIterable in interface AddressComponentgetIterable in interface AddressSegmentpublic java.util.Iterator<MACAddressSegment> iterator()
AddressComponentAddressItem.isMultiple() to determine if this instance represents multiple.
This method iterates through the individual elements.iterator in interface AddressComponentiterator in interface AddressSegmentiterator in interface java.lang.Iterable<MACAddressSegment>public int getMaxSegmentValue()
AddressSegmentAddressSegment.getUpper()getMaxSegmentValue in interface AddressSegmentpublic boolean contains(AddressSegment other)
contains in interface AddressSegmentpublic java.lang.String toHexString(boolean with0xPrefix)
AddressComponenttoHexString in interface AddressComponentpublic java.lang.String toNormalizedString()
AddressComponenttoNormalizedString in interface AddressComponentpublic java.lang.String toNormalizedString(AddressDivisionGrouping.StringOptions options)