K - The type of key in the DictionaryV - The type of the values stored in the Dictionarypublic class Dictionary<K,V> extends Object implements Iterable<Dictionary.Entry<K,V>>
| Modifier and Type | Class and Description |
|---|---|
static interface |
Dictionary.Entry<K,V>
The interface of key-value pairs accessed through the Dictionary Iterator.
|
| Constructor and Description |
|---|
Dictionary()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
forEach(java.util.function.BiConsumer<K,V> consumer)
Perform an action on each key-value pair stored in the dictionary.
|
V |
get(K key)
Get the value corresponding the given key.
|
Iterator<Dictionary.Entry<K,V>> |
iterator()
Iterate over the key-value pairs stored in the dictionary.
|
void |
put(K key,
V value)
Store a value and a corresponding key.
|
int |
size()
The number key-value pairs stored in the dictionary
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic V get(K key)
key - The keypublic void put(K key, V value)
key - A keyvalue - A valuepublic void forEach(java.util.function.BiConsumer<K,V> consumer)
consumer - The action to perform on each key-value pair in the dictionary.public int size()
public Iterator<Dictionary.Entry<K,V>> iterator()
iterator in interface Iterable<Dictionary.Entry<K,V>>Copyright © 2019. All rights reserved.