org.apache.commons.collections
Class ProxyMap
java.lang.Object
org.apache.commons.collections.ProxyMap
- Map
public abstract class ProxyMap
extends java.lang.Object
implements Map
This
Map
wraps another
Map
implementation, using the wrapped instance for its default
implementation. This class is used as a framework on which to
build to extensions for its wrapped
Map
object which
would be unavailable or inconvenient via sub-classing (but usable
via composition).
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.
$Revision: 1.15 $ $Date: 2004/02/18 01:15:42 $- Daniel Rall
- Stephen Colebourne
protected Map | map - The
Map to delegate to.
|
ProxyMap(Map map) - Constructor that uses the specified map to delegate to.
|
void | clear() - Invokes the underlying
Map.clear() method.
|
boolean | containsKey(Object key) - Invokes the underlying
Map.containsKey(Object) method.
|
boolean | containsValue(Object value) - Invokes the underlying
Map.containsValue(Object) method.
|
Set | entrySet() - Invokes the underlying
Map.entrySet() method.
|
boolean | equals(Object m) - Invokes the underlying
Map.equals(Object) method.
|
Object | get(Object key) - Invokes the underlying
Map.get(Object) method.
|
int | hashCode() - Invokes the underlying
Map.hashCode() method.
|
boolean | isEmpty() - Invokes the underlying
Map.isEmpty() method.
|
Set | keySet() - Invokes the underlying
Map.keySet() method.
|
Object | put(Object key, Object value) - Invokes the underlying
Map.put(Object,Object) method.
|
void | putAll(Map t) - Invokes the underlying
Map.putAll(Map) method.
|
Object | remove(Object key) - Invokes the underlying
Map.remove(Object) method.
|
int | size() - Invokes the underlying
Map.size() method.
|
Collection | values() - Invokes the underlying
Map.values() method.
|
map
protected Map map
The Map
to delegate to.
ProxyMap
public ProxyMap(Map map)
Constructor that uses the specified map to delegate to.
Note that the map is used for delegation, and is not copied. This is
different to the normal use of a
Map
parameter in
collections constructors.
map
- the Map
to delegate to
clear
public void clear()
Invokes the underlying Map.clear()
method.
containsKey
public boolean containsKey(Object key)
Invokes the underlying Map.containsKey(Object)
method.
containsValue
public boolean containsValue(Object value)
Invokes the underlying Map.containsValue(Object)
method.
entrySet
public Set entrySet()
Invokes the underlying Map.entrySet()
method.
equals
public boolean equals(Object m)
Invokes the underlying Map.equals(Object)
method.
get
public Object get(Object key)
Invokes the underlying Map.get(Object)
method.
hashCode
public int hashCode()
Invokes the underlying Map.hashCode()
method.
isEmpty
public boolean isEmpty()
Invokes the underlying Map.isEmpty()
method.
keySet
public Set keySet()
Invokes the underlying Map.keySet()
method.
put
public Object put(Object key,
Object value)
Invokes the underlying Map.put(Object,Object)
method.
putAll
public void putAll(Map t)
Invokes the underlying Map.putAll(Map)
method.
remove
public Object remove(Object key)
Invokes the underlying Map.remove(Object)
method.
size
public int size()
Invokes the underlying Map.size()
method.
values
public Collection values()
Invokes the underlying Map.values()
method.
Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.