public class MapWrapper<K,V>
extends java.lang.Object
implements java.util.Map<K,V>, java.io.Serializable
Constructor and Description |
---|
MapWrapper()
Initialize the new instance with default values.
|
MapWrapper(int initialCapacity)
Initialize the new instance with default values.
|
MapWrapper(java.util.Map<K,V> mapToBeWrapped)
Initialize the new instance with the given map
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all entries from this map.
|
boolean |
containsKey(java.lang.Object key)
This method returns true, if the given key can be found in this map.
|
boolean |
containsValue(java.lang.Object value)
This method returns true, if the given value is a value of any entry
in this map.
|
protected java.util.Map<K,V> |
createEmptyMap()
Subclasses may override this method to provide an instance of a different
implementation class than HashMap.
|
protected java.util.Map<K,V> |
createEmptyMap(int initialCapacity)
Subclasses may override this method to provide an instance of a different
implementation class than HashMap.
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
Returns all entries of the map
|
V |
get(java.lang.Object key)
Returns the object that was registered under the specified key.
|
protected java.util.Map<K,V> |
internalMap() |
protected void |
internalMap(java.util.Map<K,V> newValue) |
boolean |
isEmpty()
Returns true, if there is no entry in this map.
|
java.util.Set<K> |
keySet()
Returns all keys in this map.
|
V |
put(K key,
V value)
Puts the given value under the specified key into the map.
|
void |
putAll(java.util.Map<? extends K,? extends V> map)
Each entry of the given map will be added.
|
V |
remove(java.lang.Object key)
Removes the entry with the specified key.
|
int |
size()
Returns how many entries currently are in this map.
|
java.util.Collection<V> |
values()
Returns all values of the map.
|
public MapWrapper()
public MapWrapper(int initialCapacity)
initialCapacity
- Defines how many "slots" for elements are created initiallypublic void clear()
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 java.util.Set<K> keySet()
public void putAll(java.util.Map<? extends K,? extends V> map)
public V remove(java.lang.Object key)
public int size()
public java.util.Collection<V> values()
protected java.util.Map<K,V> createEmptyMap()
protected java.util.Map<K,V> createEmptyMap(int initialCapacity)
initialCapacity
- Defines how many "slots" for elements are created initially