|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbluegammon.RmsFacade
A facade for the RMS functionality, wrapping it in a key-property manner. This facade adds an overhead to the RMS of (numberOfKeys * 2) bytes comprising the lookup table for key-value / rms-value.
Keys are given as integers, but are masked to an unsigned 16-bit integer in the lookup table. This implies that only keys with values 0 to 65535 are unique. E.g., keys 1 and 65537 are the same, keys 65535 and -1 are the same.
Method Summary | |
static byte[] |
get(int key)
Returns data for a specified key. |
static boolean |
getBoolean(int key)
Returns the value of a key as a boolean. |
static char[] |
getChars(int key)
Returns the value of a key as a char array. |
static int |
getInt(int key)
Returns the value of a key as an int. |
static long |
getLong(int key)
Returns the value of a key as a long. |
static boolean |
init(int maxNbrOfKeys)
Starts up the RMS facade. |
static void |
set(int key,
byte[] data)
Sets a key to specified data. |
static void |
setBoolean(int key,
boolean b)
Sets the value of a key as a boolean. |
static void |
setChars(int key,
char[] txt)
Sets the value of a key as a char array. |
static void |
setInt(int key,
int i)
Sets the value of a key as an int. |
static void |
setLong(int key,
long l)
Sets the value of a key as a long. |
static void |
shutdown()
Closes and frees resources of the RMS facade |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void shutdown()
public static boolean init(int maxNbrOfKeys)
maxNbrOfKeys
- Maximum number of keys, 1 to 65533.
public static char[] getChars(int key)
key
- The key.
public static void setChars(int key, char[] txt)
key
- The key.txt
- The char array.public static boolean getBoolean(int key)
key
- The key.
public static void setBoolean(int key, boolean b)
key
- The key.b
- The boolean value.public static long getLong(int key)
key
- The key.
public static void setLong(int key, long l)
key
- The key.l
- The long value.public static int getInt(int key)
key
- The key.
public static void setInt(int key, int i)
key
- The key.i
- The int value.public static byte[] get(int key)
key
- The key.
public static void set(int key, byte[] data)
key
- The key.data
- The data.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |