net.sf.molae.pipe.trafo
Class KeyTransformedMap
java.lang.Object
|
+--java.util.AbstractMap
|
+--net.sf.molae.pipe.basic.AbstractMapWithSet
|
+--net.sf.molae.pipe.trafo.EntryTransformedMap
|
+--net.sf.molae.pipe.trafo.KeyTransformedMap
- All Implemented Interfaces:
- Map
- public final class KeyTransformedMap
- extends EntryTransformedMap
Provides a different view to an existing map by
transforming the key of every entry.
- Since:
- 1.1
KeyTransformedMap
public KeyTransformedMap(Map base,
Transformer transformer)
- Constructs a KeyTransformedMap object.
- Parameters:
base - the underlying maptransformer - the transformer that maps each key to another one- Throws:
NullPointerException - if any of the specified objects is
null.
containsKey
public boolean containsKey(Object key)
- Returns
true if the base map contains a mapping with a
key that would transform into the specified key.
- Overrides:
containsKey in class AbstractMap
- Parameters:
key - key whose presence in this map is to be tested- Returns:
true if the base map contains a mapping with a
key that would transform into the specified element.
containsValue
public boolean containsValue(Object value)
- Overrides:
containsValue in class AbstractMap
get
public Object get(Object key)
- Overrides:
get in class AbstractMap
put
public Object put(Object key,
Object value)
- Overrides:
put in class AbstractMap
remove
public Object remove(Object key)
- Overrides:
remove in class AbstractMap
keySet
public Set keySet()
- Description copied from class:
AbstractMapWithSet
- Returns a set view of the keys contained in this map.
This implementation returns a
typesafe version of the key set
from AbstractMap
- Overrides:
keySet in class AbstractMapWithSet
- Following copied from class:
net.sf.molae.pipe.basic.AbstractMapWithSet
- Returns:
- a set view of the keys contained in this map.
values
public Collection values()
- Overrides:
values in class AbstractMap