T - the value typepublic class IntHashMap<T> extends AbstractIntHashMap
| Modifier and Type | Class and Description |
|---|---|
static class |
IntHashMap.MapElement<V>
Implements a map element storing the contents of the buckets.
|
AbstractIntHashMap.DelegatingMapIterator<T>, AbstractIntHashMap.MapIteratorDEFAULT_CAPACITY, DEFAULT_LOADFACTOR, MAXIMUM_CAPACITY| Constructor and Description |
|---|
IntHashMap()
Constructs an empty instance with the default initial capacity and the
default load factor.
|
IntHashMap(int initialCapacity)
Constructs an empty instance with the given initial capacity and the
default load factor.
|
IntHashMap(int initialCapacity,
float loadFactor)
Constructs an empty instance with the given initial capacity and the
given load factor.
|
IntHashMap(IntHashMap<T> map)
Constructs a new IntHashMap with the same mappings as the specified Map.
|
| Modifier and Type | Method and Description |
|---|---|
protected IntHashMap.MapElement<T> |
create(int key,
java.lang.Object value)
Creates an element.
|
java.lang.Iterable<IntHashMap.MapElement<T>> |
entries()
Returns an iterator over the entries stored in this map.
|
T |
get(int 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(int key,
T value)
Associates the specified value with the specified key in this map.
|
void |
putAll(AbstractIntHashMap map)
Puts all the keys and values in the specified hash
map into this hash map.
|
T |
remove(int 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 IntHashMap()
public IntHashMap(int initialCapacity)
initialCapacity - The initial capacity for this hash map.public IntHashMap(int initialCapacity,
float loadFactor)
initialCapacity - The initial capacity for this hash map.loadFactor - The load factor for this hash map.public IntHashMap(IntHashMap<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(AbstractIntHashMap map)
putAll in class AbstractIntHashMapmap - the source mappublic java.lang.Iterable<T> values()
public java.lang.Iterable<IntHashMap.MapElement<T>> entries()
public T put(int 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 IntHashMap
previously associated null
with the specified key.public T get(int 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(int 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 IntHashMap.MapElement<T> create(int key, java.lang.Object value)
create in class AbstractIntHashMapkey - the hash key of the elementvalue - the value to be stored