public class Map<K,V>
extends java.lang.Object
| Constructor and Description |
|---|
Map()
Constructs a new Map.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(K key)
Checks if this map contains the given key.
|
V |
get(K key)
Gets the value to which the given key is mapped, or
null if this map contains no
mapping for the key. |
K[] |
keys()
Returns an array of the keys contained in this map.
|
void |
put(K key,
V value)
Associates the given value with the given key in this map.
|
void |
remove(K key)
Removes the mapping for the given key from this map.
|
V[] |
values()
Returns an array of the values contained in this map.
|
public V get(K key)
null if this map contains no
mapping for the key.key - The key.public void put(K key, V value)
key - The key.value - The value.public V[] values()
public K[] keys()
public boolean containsKey(K key)
key - The key to check.public void remove(K key)
key - The key whose mapping is to be removed from the map.