Since:
2.6.5.7
Constructor Summary |
HashMap() Constructs an empty map using a default capacity = 16 |
HashMap(int nCapacity) Constructs an empty map using a specific capacity |
Method Summary |
|
void |
clear() Removes all key/value pairs |
bool |
containsKey(Object key) Checks if there is an identical key in the map. |
Object |
get(Object key) Returns a value for a key. |
bool |
isEmpty() Returns true if the size of the map is 0 |
void |
put(Object key, Object value) Stores a key/value pair |
void |
remove(Object key) Removes a key/value pair for an identical key. |
int |
size() Returns the number of key/value pairs |
Constructor Detail |
public HashMap()
Constructs an empty map using a default capacity = 16
public HashMap(int nCapacity)
Constructs an empty map using a specific capacity
Method Detail |
public void clear()
Removes all key/value pairs
public bool containsKey(Object key)
Checks if there is an identical key in the map.
Returns a value for a key.
Returns null if there is no identical key existing in the map. Since the map allows to store null values, this method might also return null if the stored value was null.
public bool isEmpty()
Returns true if the size of the map is 0
public void put(Object key, Object value)
Stores a key/value pair
Replaces any existing value if there was an identical key already existing in the map.
public void remove(Object key)
Removes a key/value pair for an identical key.
Will do nothing if there was no identical key existing in the map.
public int size()
Returns the number of key/value pairs