public interface Map<K,V>
Modifier and Type | Method and Description |
---|---|
Iterable<Entry<K,V>> |
entrySet()
Returns an iterable collection of all key-value entries of the map.
|
V |
get(K key)
Returns the value associated with the specified key, or null if no such entry exists.
|
boolean |
isEmpty()
Tests whether the map is empty.
|
Iterable<K> |
keySet()
Returns an iterable collection of the keys contained in the map.
|
V |
put(K key,
V value)
Associates the given value with the given key.
|
V |
remove(K key)
Removes the entry with the specified key, if present, and returns
its associated value.
|
int |
size()
Returns the number of entries in the map.
|
Iterable<V> |
values()
Returns an iterable collection of the values contained in the map.
|
int size()
boolean isEmpty()
V get(K key)
key
- the key whose associated value is to be returnedV put(K key, V value)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keyV remove(K key)
key
- the key whose entry is to be removed from the mapIterable<K> keySet()
Iterable<V> values()