net.sf.molae.pipe.cube
Class CubeAsMap<E,T>
java.lang.Object
java.util.AbstractMap<K,V>
net.sf.molae.pipe.genimpl.KeySetBasedMap<List<E>,T>
net.sf.molae.pipe.cube.CubeAsMap<E,T>
- All Implemented Interfaces:
- Map<List<E>,T>
public class CubeAsMap<E,T>
- extends KeySetBasedMap<List<E>,T>
A Map implementation based on a cube.
- Since:
- 1.1
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
|
Method Summary |
T |
get(Object key)
Returns the value to which this map maps the specified key. |
Set<List<E>> |
keySet()
Returns a set view of the keys contained in this map. |
static
|
newInstance(Cube<E,T> base)
Constructs a new CubeAsMap. |
T |
put(List<E> key,
T value)
Associates the specified value with the specified key in this map. |
CubeAsMap
public CubeAsMap(Cube<E,T> base)
- Constructs a new CubeAsMap.
- Parameters:
base - the base cube
newInstance
public static <E,T> Map<List<E>,T> newInstance(Cube<E,T> base)
- Constructs a new CubeAsMap.
- Parameters:
base - the base cube
get
public T get(Object key)
- Returns the value to which this map maps the specified key.
- Specified by:
get in interface Map<List<E>,T>- Specified by:
get in class KeySetBasedMap<List<E>,T>
- Parameters:
key - key whose associated value is to be returned
- Returns:
- the value to which this map maps the specified key.
- Throws:
ClassCastException - key is not a List.
NullPointerException - key is null.
RuntimeException - depending on the base cube.
put
public T put(List<E> key,
T value)
- Associates the specified value with the specified key in this map.
- Specified by:
put in interface Map<List<E>,T>- Overrides:
put in class AbstractMap<List<E>,T>
- Parameters:
key - key with which the specified value is to be associatedvalue - value to be associated with the specified key
- Returns:
- previous value associated with specified key.
- Throws:
ClassCastException - key is not a List.
NullPointerException - key is null.
RuntimeException - depending on the base cube.
keySet
public Set<List<E>> keySet()
- Description copied from class:
KeySetBasedMap
- Returns a set view of the keys contained in this map.
- Specified by:
keySet in interface Map<List<E>,T>- Specified by:
keySet in class KeySetBasedMap<List<E>,T>
- Returns:
- a set view of the keys contained in this map.