T - public class HashMapI<T>
extends java.lang.Object
| Constructor and Description |
|---|
HashMapI()
Creates a new HashMap for integer keys.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(int key)
Returns true if this map contains a mapping for the specified key.
|
T |
get(int key)
Returns the value to which the specified key is mapped, or null if this
map contains no mapping for the key.
|
IteratorI |
keys()
Returns an iterator over the keys in this HashMap.
|
int[] |
keysArray()
Returns an array with all keys in this HashMap.
|
void |
put(int key,
T value)
Associates the specified value with the specified key in this map.
|
public void put(int key,
T value)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic T get(int key)
key - the key whose associated value is to be returnedpublic boolean containsKey(int key)
key - The key whose presence in this map is to be testedpublic IteratorI keys()
public int[] keysArray()