|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.util.HashBase
org.h2.util.IntIntHashMap
public class IntIntHashMap
A hash map with int key and int values. There is a restriction: the value -1 (NOT_FOUND) cannot be stored in the map. 0 can be stored. An empty record has key=0 and value=0. A deleted record has key=0 and value=DELETED
| Field Summary | |
|---|---|
static int |
NOT_FOUND
The value indicating that the entry has not been found. |
| Fields inherited from class org.h2.util.HashBase |
|---|
deletedCount, len, level, mask, size, zeroKey |
| Constructor Summary | |
|---|---|
IntIntHashMap()
|
|
| Method Summary | |
|---|---|
int |
get(int key)
Get the value for the given key. |
void |
put(int key,
int value)
Store the given key-value pair. |
protected void |
rehash(int newLevel)
Increase the size of the underlying table and re-distribute the elements. |
void |
remove(int key)
Remove the key-value pair with the given key. |
protected void |
reset(int newLevel)
Clear the map and reset the level to the specified value. |
| Methods inherited from class org.h2.util.HashBase |
|---|
checkSizeRemove, getIndex, size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NOT_FOUND
| Constructor Detail |
|---|
public IntIntHashMap()
| Method Detail |
|---|
protected void reset(int newLevel)
HashBase
reset in class HashBasenewLevel - the new level
public void put(int key,
int value)
key - the keyvalue - the value (-1 is not supported)public void remove(int key)
key - the keyprotected void rehash(int newLevel)
HashBase
rehash in class HashBasenewLevel - the new levelpublic int get(int key)
key - the key
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||