|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tyrex.util.HashIntTable
This class provides unsynchronized hash get, put, remove and increment of int values. If multiple threads are accessing the table then access to the table must be synchronized.
Constructor Summary | |
HashIntTable()
Create the HashIntTable using the default size |
|
HashIntTable(int size,
int defaultValue)
Create the HashIntTable with the specified size. |
Method Summary | |
int |
get(java.lang.Object key)
Get the value of the specified key. |
int |
increment(java.lang.Object key,
int increment)
Increment the value associated with the specified key by the specified amount. |
java.util.Enumeration |
keys()
Return the enumeration of keys. |
static void |
main(java.lang.String[] args)
|
int |
put(java.lang.Object key,
int value)
Associate the specified key with the specified value. |
int |
remove(java.lang.Object key)
Remove the value for specified key |
int |
size()
Return the size of the HashIntTable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HashIntTable()
public HashIntTable(int size, int defaultValue)
size
- the size (must be greater than zero)Method Detail |
public int size()
public java.util.Enumeration keys()
If the size of the HashIntTable changes (via put, remove, increment) while the keys are being enuemrated a ConcurrentModificationException is thrown by the enumeration.
public int get(java.lang.Object key)
key
- the key. Cannot be null.
public int remove(java.lang.Object key)
key
- the key. Cannot be null.
public int put(java.lang.Object key, int value)
key
- the key. Cannot be nullvalue
- the new value
public int increment(java.lang.Object key, int increment)
key
- the key. Cannot be nullincrement
- the increment
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |