T
- Generic Type.public class IntTHashMap<T>
extends java.lang.Object
implements java.lang.Iterable<T>
rehash()
will not be triggered automatically.
Statistics can be examined by getHashPopulation()
,
getHashSize()
, getSize()
and getMaxCollisions()
.Constructor and Description |
---|
IntTHashMap(int capacity) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
contains(int key) |
T |
get(int key)
Returns a value for a key.
|
int |
getHashPopulation() |
int |
getHashSize() |
int |
getMaxCollisions() |
int |
getSize() |
java.util.Iterator<T> |
iterator() |
void |
put(int key,
T value)
Adds a new key/value.
|
void |
rehash()
Increases the Hash by factor 2.
|
T |
remove(int key)
Removes an element.
|
java.lang.String |
toString() |
public IntTHashMap(int capacity)
capacity
- Initially expected number of elements.
public void clear()
public int getSize()
public int getHashSize()
public int getMaxCollisions()
put(int, Object)
or rehash()
.
For performance reasons not after remove(int)
.public int getHashPopulation()
public void put(int key, T value)
key
- intvalue
- Object Tpublic T remove(int key)
key
- intpublic boolean contains(int key)
key
- intpublic T get(int key)
key
- intpublic java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public void rehash()
public java.lang.String toString()
toString
in class java.lang.Object