public interface Dictionary<K,V>
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<Entry<K,V>> |
entries()
Returns an iterator containing all the entries in the dictionary.
|
Entry<K,V> |
find(K key)
Returns an entry containing the given key, or null if
no such entry exists.
|
java.lang.Iterable<Entry<K,V>> |
findAll(K key)
Returns an iterator containing all the entries containing the
given key, or an empty iterator if no such entries exist.
|
Entry<K,V> |
insert(K key,
V value)
Inserts an item into the dictionary.
|
boolean |
isEmpty()
Returns whether the dictionary is empty.
|
Entry<K,V> |
remove(Entry<K,V> e)
Removes and returns the given entry from the dictionary.
|
int |
size()
Returns the number of entries in the dictionary.
|
java.lang.Iterable<Entry<K,V>> entries()
Entry<K,V> find(K key) throws InvalidKeyException
InvalidKeyException
java.lang.Iterable<Entry<K,V>> findAll(K key) throws InvalidKeyException
InvalidKeyException
Entry<K,V> insert(K key, V value) throws InvalidKeyException
InvalidKeyException
boolean isEmpty()
Entry<K,V> remove(Entry<K,V> e) throws InvalidEntryException
InvalidEntryException
int size()