net.sf.molae.pipe.cube
Class CubeAsMap<E,T>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by net.sf.molae.pipe.genimpl.KeySetBasedMap<List<E>,T>
          extended by 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 Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
CubeAsMap(Cube<E,T> base)
          Constructs a new CubeAsMap.
 
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
<E,T> Map<List<E>,T>
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.
 
Methods inherited from class net.sf.molae.pipe.genimpl.KeySetBasedMap
clear, containsKey, entrySet, remove, size
 
Methods inherited from class java.util.AbstractMap
clone, containsValue, equals, hashCode, isEmpty, putAll, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CubeAsMap

public CubeAsMap(Cube<E,T> base)
Constructs a new CubeAsMap.

Parameters:
base - the base cube
Method Detail

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 associated
value - 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.