|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Map<KeyType,ValueType>
Map interface. A map stores key/value pairs. In our implementations, duplicate keys are not allowed.
Nested Class Summary | |
---|---|
static interface |
Map.Entry<KeyType,ValueType>
The interface used to access the key/value pairs in a map. |
Method Summary | |
---|---|
void |
clear()
Removes all key value pairs from the map. |
boolean |
containsKey(KeyType key)
Tests if this map contains a given key. |
Set<Map.Entry<KeyType,ValueType>> |
entrySet()
Return a set of Map.Entry objects corresponding to the key/value pairs in the map. |
ValueType |
get(KeyType key)
Returns the value in the map associated with the key. |
boolean |
isEmpty()
Tests if this map is empty. |
Set<KeyType> |
keySet()
Returns the keys in the map. |
ValueType |
put(KeyType key,
ValueType value)
Adds the key value pair to the map, overriding the original value if the key was already present. |
ValueType |
remove(KeyType key)
Remove the key and its value from the map. |
int |
size()
Returns the number of keys in this map. |
Collection<ValueType> |
values()
Returns the values in the map. |
Method Detail |
---|
int size()
boolean isEmpty()
boolean containsKey(KeyType key)
key
- the key to search for.
ValueType get(KeyType key)
key
- the key to search for.
ValueType put(KeyType key, ValueType value)
key
- the key to insert.value
- the value to insert.
ValueType remove(KeyType key)
key
- the key to remove.
void clear()
Set<KeyType> keySet()
Collection<ValueType> values()
Set<Map.Entry<KeyType,ValueType>> entrySet()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |