V
- type of the value instance.public class LongMap<V>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
LongMap.Node<V> |
Modifier and Type | Field and Description |
---|---|
private int |
growAt
|
private static float |
LOAD_FACTOR |
private int |
size
Number of entries currently in the map.
|
private LongMap.Node<V>[] |
table |
Constructor and Description |
---|
LongMap()
Initialize an empty LongMap.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(long key)
Whether
key is present in the map. |
private static <V> LongMap.Node<V>[] |
createArray(int sz) |
V |
get(long key)
Get value for this
key |
private void |
grow() |
private int |
index(long key) |
private void |
insert(LongMap.Node<V> n) |
V |
put(long key,
V value)
Put a new entry into the map
|
V |
remove(long key)
Remove an entry from the map
|
private static final float LOAD_FACTOR
private LongMap.Node<V>[] table
private int size
private int growAt
public boolean containsKey(long key)
key
is present in the map.key
- the key to find.true
if key
is present in the map.public V get(long key)
key
key
- the key to find.null
.public V remove(long key)
key
- key to remove from the map.null
.public V put(long key, V value)
key
- key to store value
under.value
- new value.private void insert(LongMap.Node<V> n)
private void grow()
private final int index(long key)
private static final <V> LongMap.Node<V>[] createArray(int sz)