|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- The key type.V
- The value type.public interface Dictionary<K,V>
An interface for the Dictionary ADT.
Method Summary | |
---|---|
V |
add(K key,
V value)
Adds a new entry to this dictionary. |
void |
clear()
Removes all entries from this dictionary. |
boolean |
contains(K key)
Sees whether a specific entry is in this dictionary. |
Set<DictPair<K,V>> |
getEntrySet()
Returns a Set of the key-value pairs stored in the dictionary. |
Set<K> |
getKeySet()
Returns a Set that contains all the keys stored in the dictionary. |
V |
getValue(K key)
Retrieves from this dictionary the value associated with a given key. |
boolean |
isEmpty()
Sees whether this dictionary is empty. |
V |
remove(K key)
Removes a specific entry from this dictionary. |
int |
size()
Gets the size of this dictionary. |
Method Detail |
---|
V add(K key, V value)
V remove(K key)
key
- The key of the entry to be removed.
V getValue(K key)
boolean contains(K key)
Set<K> getKeySet()
Set<DictPair<K,V>> getEntrySet()
int size()
boolean isEmpty()
void clear()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |