|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.collections.map.AbstractMapDecorator
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 inherited from class java.util.Map |
Map.Entry |
Field Summary | |
protected Map |
map
The map to decorate |
Constructor Summary | |
protected |
AbstractMapDecorator()
Constructor only used in deserialization, do not use otherwise. |
|
AbstractMapDecorator(Map map)
Constructor that wraps (not copies). |
Method Summary | |
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Set |
entrySet()
|
boolean |
equals(Object object)
|
Object |
get(Object key)
|
protected Map |
getMap()
Gets the map being decorated. |
int |
hashCode()
|
boolean |
isEmpty()
|
Set |
keySet()
|
Object |
put(Object key,
Object value)
|
void |
putAll(Map mapToCopy)
|
Object |
remove(Object key)
|
int |
size()
|
String |
toString()
|
Collection |
values()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected transient Map map
Constructor Detail |
protected AbstractMapDecorator()
public AbstractMapDecorator(Map map)
map
- the map to decorate, must not be null
IllegalArgumentException
- if the collection is nullMethod Detail |
protected Map getMap()
public void clear()
clear
in interface Map
public boolean containsKey(Object key)
containsKey
in interface Map
public boolean containsValue(Object value)
containsValue
in interface Map
public Set entrySet()
entrySet
in interface Map
public Object get(Object key)
get
in interface Map
public boolean isEmpty()
isEmpty
in interface Map
public Set keySet()
keySet
in interface Map
public Object put(Object key, Object value)
put
in interface Map
public void putAll(Map mapToCopy)
putAll
in interface Map
public Object remove(Object key)
remove
in interface Map
public int size()
size
in interface Map
public Collection values()
values
in interface Map
public boolean equals(Object object)
equals
in interface Map
public int hashCode()
hashCode
in interface Map
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |