public interface Dictionary<K,V>
Modifier and Type | Interface and Description |
---|---|
static class |
Dictionary.Pair<K,V>
Class representing a key/value pair.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(K key)
Tests the existence of a key in the dictionary.
|
V |
get(K key)
Retrieves the value for the given key.
|
V |
put(K key,
V value)
Sets the value of the given key, creating a new entry or replacing the
existing value.
|
V |
remove(K key)
Removes a key/value pair from the map.
|
V get(K key)
key
- The key whose value is to be returned.V put(K key, V value)
key
- The key whose value is to be set.value
- The value to be associated with the given key.V remove(K key)
key
- The key whose mapping is to be removed.boolean containsKey(K key)
key
- The key whose presence in the dictionary is to be tested.