public abstract class AddressDivisionBase extends java.lang.Object implements AddressItem, AddressStringDivision
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes()
Gets the bytes for the lowest address in the range represented by this address division.
|
byte[] |
getBytes(byte[] bytes)
Gets the value for the lowest address in the range represented by this address division.
|
abstract int |
getDefaultTextualRadix() |
static int |
getDigitCount(long value,
int radix) |
int |
getLowerStandardString(int segmentIndex,
AddressSegmentParams params,
java.lang.StringBuilder appendable)
Configures a segment string according to the given params and the given segment index, but using only the lower value of the segment range,
if there is a range.
|
abstract int |
getMaxDigitCount() |
int |
getStandardString(int segmentIndex,
AddressSegmentParams params,
java.lang.StringBuilder appendable)
Produces a string to represent the segment, using wildcards and range characters.
|
java.lang.String |
getString()
Produces a normalized string to represent the segment.
|
byte[] |
getUpperBytes() |
byte[] |
getUpperBytes(byte[] bytes)
Copies the bytes of the largest address item represented by this address item into the supplied array,
and returns that array.
|
java.lang.String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBitCount, getCount, includesMax, includesZero, isFullRange, isMax, isMultiple, isZero
getDigitCount, getMaxDigitCount, isBoundedBy
public byte[] getBytes()
Since bytes are signed values while addresses are unsigned, values greater than 127 are represented as the (negative) two's complement value of the actual value. You can get the unsigned integer value i from byte b using i = 0xff & b.
getBytes
in interface AddressItem
public byte[] getBytes(byte[] bytes)
If the value fits in the specified array, the same array is returned with the value. Otherwise, a new array is allocated and returned with the value.
You can use AddressItem.getBitCount()
to determine the required array length for the bytes.
Since bytes are signed values while addresses are unsigned, values greater than 127 are represented as the (negative) two's complement value of the actual value. You can get the unsigned integer value i from byte b using i = 0xff & b.
getBytes
in interface AddressItem
public byte[] getUpperBytes()
getUpperBytes
in interface AddressItem
public byte[] getUpperBytes(byte[] bytes)
AddressItem
getUpperBytes
in interface AddressItem
public abstract int getDefaultTextualRadix()
public abstract int getMaxDigitCount()
public static int getDigitCount(long value, int radix)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getString()
public int getLowerStandardString(int segmentIndex, AddressSegmentParams params, java.lang.StringBuilder appendable)
AddressStringDivision
If appendable is null, simply returns the length of the string that would have been appended.
getLowerStandardString
in interface AddressStringDivision
public int getStandardString(int segmentIndex, AddressSegmentParams params, java.lang.StringBuilder appendable)
getStandardString
in interface AddressStringDivision