net.sf.molae.pipe.trafo
Class ValueTransformedMap<K,S,V>
java.lang.Object
java.util.AbstractMap<K,V>
net.sf.molae.pipe.basic.AbstractMapWithSet<K,V>
net.sf.molae.pipe.trafo.EntryTransformedMap<Map.Entry<K,S>,K,V>
net.sf.molae.pipe.trafo.ValueTransformedMap<K,S,V>
- All Implemented Interfaces:
- Map<K,V>
public final class ValueTransformedMap<K,S,V>
- extends EntryTransformedMap<Map.Entry<K,S>,K,V>
Provides a different view to an existing map by
transforming the key of every entry.
- Since:
- 1.1
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
ValueTransformedMap
public ValueTransformedMap(Map<K,S> base,
TwoWayTransformer<S,V> transformer)
- Constructs a ValueTransformedMap object.
- Parameters:
base - the underlying maptransformer - the transformer that maps each element to another one
- Throws:
NullPointerException - if any of the specified objects is
null.
newInstance
public static <K,S,V> ValueTransformedMap<K,S,V> newInstance(Map<K,S> base,
TwoWayTransformer<S,V> transformer)
- Constructs a ValueTransformedMap object.
- Parameters:
base - the underlying maptransformer - the transformer that maps each element to another one
- Throws:
NullPointerException - if any of the specified objects is
null.- Since:
- 2.0
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey in interface Map<K,V>- Overrides:
containsKey in class AbstractMap<K,V>
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue in interface Map<K,V>- Overrides:
containsValue in class AbstractMap<K,V>
get
public V get(Object key)
- Specified by:
get in interface Map<K,V>- Overrides:
get in class AbstractMap<K,V>
put
public V put(K key,
V value)
- Specified by:
put in interface Map<K,V>- Overrides:
put in class AbstractMap<K,V>
remove
public V remove(Object key)
- Specified by:
remove in interface Map<K,V>- Overrides:
remove in class AbstractMap<K,V>
keySet
public Set<K> 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
- Specified by:
keySet in interface Map<K,V>- Overrides:
keySet in class AbstractMapWithSet<K,V>
- Returns:
- a set view of the keys contained in this map.
values
public Collection<V> values()
- Specified by:
values in interface Map<K,V>- Overrides:
values in class AbstractMap<K,V>