public interface Map<K,V>
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<Entry<K,V>> |
entries()
Returns an iterable object containing all the entries in the map.
|
V |
get(K key)
Returns the value associated with a key.
|
boolean |
isEmpty()
Returns whether the map is empty.
|
java.lang.Iterable<K> |
keys()
Returns an iterable object containing all the keys in the map.
|
V |
put(K key,
V value)
Puts a given key-value pair in the map, replacing a previous
one, if any, and returns the old value.
|
V |
remove(K key)
Removes the key-value pair with a given key.
|
int |
size()
Returns the number of items in the map.
|
java.lang.Iterable<V> |
values()
Returns an iterable object containing all the values in the map.
|
java.lang.Iterable<Entry<K,V>> entries()
V get(K key) throws InvalidKeyException
InvalidKeyException
boolean isEmpty()
java.lang.Iterable<K> keys()
V put(K key, V value) throws InvalidKeyException
InvalidKeyException
V remove(K key) throws InvalidKeyException
InvalidKeyException
int size()
java.lang.Iterable<V> values()