|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Map<K,V>
An interface for a map which binds a key uniquely to a value.
Method Summary | |
---|---|
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. |
Method Detail |
---|
int size()
boolean isEmpty()
V put(K key, V value) throws InvalidKeyException
InvalidKeyException
V get(K key) throws InvalidKeyException
InvalidKeyException
V remove(K key) throws InvalidKeyException
InvalidKeyException
java.lang.Iterable<K> keys()
java.lang.Iterable<V> values()
java.lang.Iterable<Entry<K,V>> entries()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |