public abstract class

AbstractMapDecorator

extends Object
implements Map<K, V>
java.lang.Object
   ↳ org.apache.commons.collections.map.AbstractMapDecorator
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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.

Summary

Fields
protected Map map The map to decorate
Public Constructors
AbstractMapDecorator(Map map)
Constructor that wraps (not copies).
Protected Constructors
AbstractMapDecorator()
Constructor only used in deserialization, do not use otherwise.
Public Methods
void clear()
boolean containsKey(Object key)
boolean containsValue(Object value)
Set entrySet()
boolean equals(Object object)
Object get(Object key)
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()
Protected Methods
Map getMap()
Gets the map being decorated.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.util.Map

Fields

protected Map map

The map to decorate

Public Constructors

public AbstractMapDecorator (Map map)

Constructor that wraps (not copies).

Parameters
map the map to decorate, must not be null
Throws
IllegalArgumentException if the collection is null

Protected Constructors

protected AbstractMapDecorator ()

Constructor only used in deserialization, do not use otherwise.

Public Methods

public void clear ()

public boolean containsKey (Object key)

public boolean containsValue (Object value)

public Set entrySet ()

public boolean equals (Object object)

public Object get (Object key)

public int hashCode ()

public boolean isEmpty ()

public Set keySet ()

public Object put (Object key, Object value)

public void putAll (Map mapToCopy)

public Object remove (Object key)

public int size ()

public String toString ()

public Collection values ()

Protected Methods

protected Map getMap ()

Gets the map being decorated.

Returns
  • the decorated map