local.tomas.util.collections
Class MappedMap<K,J,F,T>
java.lang.Object
local.tomas.util.collections.MappedMap<K,J,F,T>
- Type Parameters:
K - mapped map key typeJ - base map key typeF - base map value typeT - mapped map value type
- All Implemented Interfaces:
- Map<K,T>
- Direct Known Subclasses:
- SimpleMappedMap
public class MappedMap<K,J,F,T>
- extends Object
- implements Map<K,T>
Mapped map.
The mapped map maps the values of a base map to the values of a target map using two mappings
passed to the constructor.
The resulting map is defined as follows:
mapped_map[key] := value_mapping(base_map[key_mapping(key)])
- Author:
- tomas.teubner
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
map
protected Map<J,F> map
keyMapping
protected ObjectMapping<J> keyMapping
valueMapping
protected ObjectMapping<T> valueMapping
MappedMap
public MappedMap(Map<J,F> map,
ObjectMapping<J> keyMapping,
ObjectMapping<T> valueMapping)
- Construct mapped map.
- Parameters:
map - base mapkeyMapping - maps target keys to base keysvalueMapping - maps base values to target values
size
public int size()
- Specified by:
size in interface Map<K,T>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Map<K,T>
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey in interface Map<K,T>
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue in interface Map<K,T>
get
public T get(Object key)
- Specified by:
get in interface Map<K,T>
put
public T put(K key,
T value)
- Specified by:
put in interface Map<K,T>
- Throws:
UnsupportedOperationException - when invoked
remove
public T remove(Object key)
- Specified by:
remove in interface Map<K,T>
putAll
public void putAll(Map<? extends K,? extends T> t)
- Specified by:
putAll in interface Map<K,T>
- Throws:
UnsupportedOperationException - when invoked
clear
public void clear()
- Specified by:
clear in interface Map<K,T>
keySet
public Set<K> keySet()
- Specified by:
keySet in interface Map<K,T>
- Throws:
UnsupportedOperationException - when invoked
values
public Collection<T> values()
- Specified by:
values in interface Map<K,T>
entrySet
public Set<Map.Entry<K,T>> entrySet()
- Specified by:
entrySet in interface Map<K,T>
- Throws:
UnsupportedOperationException - when invoked
Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.