public final class TableId extends U8Id implements Comparable<TableId>
MAX
.
All constructors for this class are private.
Creating instances of TableId
is done via the static
methods on the class.
Instances of this class are immutable, making them inherently threadsafe.
This class overrides UnsignedIntBasedId.equals(java.lang.Object)
and UnsignedIntBasedId.hashCode()
so that
instances play nicely with the Collection classes.
This class implements the Comparable
interface to ensure that
a sorted list of table IDs is presented in an intuitive order.
Modifier and Type | Field and Description |
---|---|
static TableId |
ALL
Denotes all tables.
|
static TableId |
MAX
Denotes the last usable table ID number.
|
id
E_BAD, E_NULL_BYTES, E_NULL_STR, E_OOR, MIN_VALUE
Modifier and Type | Method and Description |
---|---|
int |
compareTo(TableId o)
Implements the Comparable interface, to return table IDs in
natural order.
|
static TableId |
tid(String s)
Convenience method that returns the table ID for the given string.
|
String |
toString()
Returns a string representation of this id.
|
static TableId |
valueOf(byte b)
Returns an object that represents the table ID defined by the
specified byte.
|
static TableId |
valueOf(int tid)
Returns an object that represents the table ID defined by the
specified integer.
|
static TableId |
valueOf(String s)
Returns an object that represents the table ID defined by the
specified string.
|
rangeCheck, toByte
equals, hashCode, toInt
parseIntStr, parseLongStr
getRefQ, keyFromBytes
public static final TableId MAX
TableId.MAX
.)public static final TableId ALL
public String toString()
UnsignedIntBasedId
toString
in class UnsignedIntBasedId
public int compareTo(TableId o)
compareTo
in interface Comparable<TableId>
o
- the other table IDComparable.compareTo(T)
public static TableId valueOf(int tid)
tid
- the table IDIllegalArgumentException
- if the table ID is invalidpublic static TableId valueOf(String s)
s
- the table ID as a stringIllegalArgumentException
- if the string is invalidNullPointerException
- if the string is nullpublic static TableId tid(String s)
valueOf(String)
. By using a
static import of this method, code may be written more concisely. For
example, the following two statements are equivalent:
TableId t = TableId.valueOf("2"); TableId t = tid("2");
s
- the table ID as a stringIllegalArgumentException
- if the string is invalidNullPointerException
- if the string is nullpublic static TableId valueOf(byte b)
b
- the encoded IDCopyright © 2015. All Rights Reserved.