public abstract class U16Id extends UnsignedIntBasedId
Modifier and Type | Field and Description |
---|---|
protected static String |
E_BYTES_BAD_LEN
Error message when byte array is incorrect length.
|
static int |
LENGTH_IN_BYTES
Length of the identifier when encoded as a byte array.
|
static int |
MAX_VALUE
Highest valid value.
|
id
E_BAD, E_NULL_BYTES, E_NULL_STR, E_OOR, MIN_VALUE
Modifier | Constructor and Description |
---|---|
protected |
U16Id(int id)
Constructs the id.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
rangeCheck(int value)
Ensures that the given value is within range.
|
byte[] |
toByteArray()
Returns this id as a 2-byte array.
|
equals, hashCode, toInt, toString
parseIntStr, parseLongStr
getRefQ, keyFromBytes
public static final int MAX_VALUE
public static final int LENGTH_IN_BYTES
protected static final String E_BYTES_BAD_LEN
public byte[] toByteArray()
protected static void rangeCheck(int value)
value
- the value to checkIllegalArgumentException
- if the value is out of rangeCopyright © 2015. All Rights Reserved.