K
- the type of keys maintained by this mapV
- the type of mapped valuespublic class DefaultingDictionary<K,V> extends LinkedHashMap<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
DefaultingDictionary(V defaultValue)
Construct the defaultingDictionary using the defaultValue provided.
|
DefaultingDictionary(V defaultValue,
Map<K,V> defaultingDictionaryMap)
Construct DefaultingDictionary using the given defaultValue and entries from the given defaultingDictionaryMap.
|
Modifier and Type | Method and Description |
---|---|
V |
get(Object key) |
V |
getDefaultValue()
Return the defaultValue for this class.
|
clear, containsValue, entrySet, forEach, getOrDefault, keySet, removeEldestEntry, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
public DefaultingDictionary(V defaultValue)
defaultValue
- The defaultValue to be returned if a key is not present in the mappublic DefaultingDictionary(V defaultValue, Map<K,V> defaultingDictionaryMap)
defaultValue
- The defaultValue to be returned if a key is not present in the mapdefaultingDictionaryMap
- A Map whose entries will be inserted into the DefaultingDictionaryCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.