T - the value typepublic class LongHashMap<T> extends AbstractLongHashMap
| Modifier and Type | Class and Description |
|---|---|
static class |
LongHashMap.MapElement<V>
Implements a map element storing the contents of the buckets.
|
AbstractLongHashMap.DelegatingMapIterator<T>, AbstractLongHashMap.MapIteratorDEFAULT_CAPACITY, DEFAULT_LOADFACTOR, MAXIMUM_CAPACITY| Constructor and Description |
|---|
LongHashMap()
Constructs an empty instance with the default initial capacity and the
default load factor.
|
LongHashMap(int initialCapacity)
Constructs an empty instance with the given initial capacity and the
default load factor.
|
LongHashMap(int initialCapacity,
float loadFactor)
Constructs an empty instance with the given initial capacity and the
given load factor.
|
LongHashMap(LongHashMap<T> map)
Constructs a new LongHashMap with the same mappings as the specified Map.
|
| Modifier and Type | Method and Description |
|---|---|
protected LongHashMap.MapElement<T> |
create(long key,
java.lang.Object value)
Creates an element.
|
java.lang.Iterable<LongHashMap.MapElement<T>> |
entries()
Returns an iterator over the entries stored in this map.
|
T |
get(long key)
Returns the value to which the specified key is mapped in this identity
hash map, or
null if the map contains no mapping for this
key. |
T |
put(long key,
T value)
Associates the specified value with the specified key in this map.
|
void |
putAll(AbstractLongHashMap map)
Puts all the keys and values in the specified hash
map into this hash map.
|
T |
remove(long key)
Removes the mapping for this key from this map if present.
|
java.lang.Iterable<T> |
values()
Returns an iterator over the values stored in this map.
|
clear, containsKey, elements, getCapacity, getElement, getLoadFactor, getObjectCounter, isEmpty, keySet, putElement, removeElement, removeNotIn, setRehash, sizepublic LongHashMap()
public LongHashMap(int initialCapacity)
initialCapacity - The initial capacity for this hash map.public LongHashMap(int initialCapacity,
float loadFactor)
initialCapacity - The initial capacity for this hash map.loadFactor - The load factor for this hash map.public LongHashMap(LongHashMap<T> map)
map - The map whose mappings are to be placed in this map.java.lang.NullPointerException - if the specified map is null.public void putAll(AbstractLongHashMap map)
putAll in class AbstractLongHashMapmap - the source mappublic java.lang.Iterable<T> values()
public java.lang.Iterable<LongHashMap.MapElement<T>> entries()
public T put(long key, T value)
key - The key with which the specified value is to be associated.value - The value to be associated with the specified key.null if there was no mapping for key. A
null return can also indicate that the LongHashMap
previously associated null
with the specified key.public T get(long key)
null if the map contains no mapping for this
key. A return value of null does not necessarily indicate
that the map contains no mapping for the key; it is also possible that
the map explicitly maps the key to null. The
containsKey method may be used to distinguish these two
cases.key - The key whose associated value is to be returned.null if the map contains no mapping for this key.public T remove(long key)
key - The key whose mapping is to be removed from the map.null if there was no mapping for key. A
null return can also indicate that the map
previously associated null with the specified key.protected LongHashMap.MapElement<T> create(long key, java.lang.Object value)
create in class AbstractLongHashMapkey - the hash key of the elementvalue - the value to be stored