K
- the type of the keys in the mapV
- the type of the values in the mapjava.util.Map<K,V>
, Get<K,V>
, IterableGet<K,V>
, IterableMap<K,V>
, Put<K,V>
AbstractBidiMapDecorator
, AbstractOrderedMapDecorator
, AbstractSortedMapDecorator
, DefaultedMap
, FixedSizeMap
, LazyMap
, ListOrderedMap
, MultiKeyMap
, MultiValueMap
, PassiveExpiringMap
, PredicatedMap
, TransformedMap
, UnmodifiableMap
public abstract class AbstractMapDecorator<K,V> extends AbstractIterableMap<K,V>
Methods are forwarded directly to the decorated map.
This implementation does not perform any special processing with
entrySet()
, keySet()
or values()
. Instead
it simply returns the set/collection from the wrapped map. This may be
undesirable, for example if you are trying to write a validating
implementation it would provide a loophole around the validation.
But, you might want that loophole, so this class is kept simple.
Modifier | Constructor | Description |
---|---|---|
protected |
AbstractMapDecorator() |
Constructor only used in deserialization, do not use otherwise.
|
protected |
AbstractMapDecorator(java.util.Map<K,V> map) |
Constructor that wraps (not copies).
|
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
|
boolean |
containsKey(java.lang.Object key) |
|
boolean |
containsValue(java.lang.Object value) |
|
protected java.util.Map<K,V> |
decorated() |
Gets the map being decorated.
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
|
boolean |
equals(java.lang.Object object) |
|
V |
get(java.lang.Object key) |
|
int |
hashCode() |
|
boolean |
isEmpty() |
|
java.util.Set<K> |
keySet() |
|
V |
put(K key,
V value) |
Note that the return type is Object, rather than V as in the Map interface.
|
void |
putAll(java.util.Map<? extends K,? extends V> mapToCopy) |
|
V |
remove(java.lang.Object key) |
|
int |
size() |
|
java.lang.String |
toString() |
|
java.util.Collection<V> |
values() |
mapIterator
protected AbstractMapDecorator()
protected java.util.Map<K,V> decorated()
public void clear()
Map.clear()
public boolean containsKey(java.lang.Object key)
Map.containsKey(Object)
public boolean containsValue(java.lang.Object value)
Map.containsValue(Object)
public V get(java.lang.Object key)
Map.get(Object)
public boolean isEmpty()
Map.isEmpty()
public java.util.Set<K> keySet()
Map.keySet()
public V put(K key, V value)
Put
Map.put(Object, Object)
public void putAll(java.util.Map<? extends K,? extends V> mapToCopy)
Map.putAll(Map)
public V remove(java.lang.Object key)
Map.remove(Object)
public int size()
Map.size()
public java.util.Collection<V> values()
Map.values()
public boolean equals(java.lang.Object object)
public int hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2001-2019 - Apache Software Foundation