public class MapBasedDictionary<K,V> extends Dictionary<K,V> implements Map<K,V>
LinkedHashMap is used, if no Map is specified.
This implementation will enforce the Dictionary behaviour over the map when
it comes to handling null values. As opposed to a Map, the Dictionary always
throws NullPointerException if a given argument is null.Map,
Dictionary| Constructor and Description |
|---|
MapBasedDictionary()
Default constructor.
|
MapBasedDictionary(Dictionary<? extends K,? extends V> dictionary)
Constructor for dealing with existing Dictionary.
|
MapBasedDictionary(int initialCapacity) |
MapBasedDictionary(Map<K,V> map) |
MapBasedDictionary(Map<K,V> map,
Dictionary<? extends K,? extends V> dictionary) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Enumeration<V> |
elements() |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object obj) |
V |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Enumeration<K> |
keys() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
<T extends K> |
putAll(Dictionary<T,? extends V> dictionary) |
void |
putAll(Map<? extends K,? extends V> t) |
V |
remove(Object key) |
int |
size() |
String |
toString() |
Collection<V> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic MapBasedDictionary()
public MapBasedDictionary(int initialCapacity)
public MapBasedDictionary(Dictionary<? extends K,? extends V> dictionary)
dictionary - public boolean containsKey(Object key)
containsKey in interface Map<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>public boolean isEmpty()
public <T extends K> void putAll(Dictionary<T,? extends V> dictionary)
public int size()
public Enumeration<V> elements()
elements in class Dictionary<K,V>public Enumeration<K> keys()
keys in class Dictionary<K,V>public boolean equals(Object obj)
Copyright © 2006–2016. All rights reserved.