public class IntIntHashMap extends HashBase
| Modifier and Type | Field and Description |
|---|---|
static int |
NOT_FOUND
The value indicating that the entry has not been found.
|
autoShrink, deletedCount, len, level, mask, size, zeroKey| Constructor and Description |
|---|
IntIntHashMap()
Creates a new instance of a hash map.
|
IntIntHashMap(boolean autoShrink)
Creates a new instance of a hash map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the collection.
|
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.
|
checkSizeRemove, getIndex, sizepublic static final int NOT_FOUND
public IntIntHashMap()
public IntIntHashMap(boolean autoShrink)
autoShrink - enable auto-shrinkprotected void reset(int newLevel)
HashBasepublic 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)
HashBasepublic int get(int key)
key - the key