|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.collections4.map.AbstractIterableMap<K,V>
org.apache.commons.collections4.map.AbstractMapDecorator<K,V>
K
- the type of the keys in the mapV
- the type of the values in the mappublic abstract class AbstractMapDecorator<K,V>
Provides a base decorator that enables additional functionality to be added to a Map via decoration.
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Constructor Summary | |
---|---|
protected |
AbstractMapDecorator()
Constructor only used in deserialization, do not use otherwise. |
protected |
AbstractMapDecorator(Map<K,V> map)
Constructor that wraps (not copies). |
Method Summary | |
---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
protected Map<K,V> |
decorated()
Gets the map being decorated. |
Set<Map.Entry<K,V>> |
entrySet()
|
boolean |
equals(Object object)
|
V |
get(Object key)
|
int |
hashCode()
|
boolean |
isEmpty()
|
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(Map<? extends K,? extends V> mapToCopy)
|
V |
remove(Object key)
|
int |
size()
|
String |
toString()
|
Collection<V> |
values()
|
Methods inherited from class org.apache.commons.collections4.map.AbstractIterableMap |
---|
mapIterator |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AbstractMapDecorator()
protected AbstractMapDecorator(Map<K,V> map)
map
- the map to decorate, must not be null
IllegalArgumentException
- if the collection is nullMethod Detail |
---|
protected Map<K,V> decorated()
public void clear()
Map.clear()
public boolean containsKey(Object key)
Map.containsKey(Object)
public boolean containsValue(Object value)
Map.containsValue(Object)
public Set<Map.Entry<K,V>> entrySet()
Map.entrySet()
public V get(Object key)
Map.get(Object)
public boolean isEmpty()
Map.isEmpty()
public Set<K> keySet()
Map.keySet()
public V put(K key, V value)
Put
Map.put(Object, Object)
public void putAll(Map<? extends K,? extends V> mapToCopy)
Map.putAll(Map)
public V remove(Object key)
Map.remove(Object)
public int size()
Map.size()
public Collection<V> values()
Map.values()
public boolean equals(Object object)
equals
in interface Map<K,V>
equals
in class Object
public int hashCode()
hashCode
in interface Map<K,V>
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |