public class MapBasedDictionary<K,V>
extends java.util.Dictionary<K,V>
implements java.util.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| Modifier and Type | Class and Description |
|---|---|
private static class |
MapBasedDictionary.IteratorBasedEnumeration<E>
Enumeration wrapper around an Iterator.
|
| Constructor and Description |
|---|
MapBasedDictionary()
Default constructor.
|
MapBasedDictionary(java.util.Dictionary<? extends K,? extends V> dictionary)
Constructor for dealing with existing Dictionary.
|
MapBasedDictionary(int initialCapacity) |
MapBasedDictionary(java.util.Map<K,V> map) |
MapBasedDictionary(java.util.Map<K,V> map,
java.util.Dictionary<? extends K,? extends V> dictionary) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Enumeration<V> |
elements() |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
boolean |
equals(java.lang.Object obj) |
V |
get(java.lang.Object key) |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Enumeration<K> |
keys() |
java.util.Set<K> |
keySet() |
V |
put(K key,
V value) |
<T extends K> |
putAll(java.util.Dictionary<T,? extends V> dictionary) |
void |
putAll(java.util.Map<? extends K,? extends V> t) |
V |
remove(java.lang.Object key) |
int |
size() |
java.lang.String |
toString() |
java.util.Collection<V> |
values() |
public MapBasedDictionary()
public MapBasedDictionary(int initialCapacity)
public MapBasedDictionary(java.util.Dictionary<? extends K,? extends V> dictionary)
dictionary - public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public V get(java.lang.Object key)
public boolean isEmpty()
public V remove(java.lang.Object key)
public int size()
public java.util.Enumeration<V> elements()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)