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

java.lang.Object
  extended by net.sf.molae.pipe.cube.AbstractCube<E,T>
      extended by net.sf.molae.pipe.cube.VaryingCube<E,T>
          extended by net.sf.molae.pipe.cube.MapBasedCube<E,T>
All Implemented Interfaces:
Cube<E,T>

public class MapBasedCube<E,T>
extends VaryingCube<E,T>

Map based cube. Structural changes of the map (changes to the edges list) are not reflected in the cube.

Since:
1.1

Constructor Summary
MapBasedCube()
          Constructs a new MapBasedCube.
MapBasedCube(Cube<E,T> cube)
          Constructs a new MapBasedCube that contains the values of the specified cube.
MapBasedCube(Map<List<E>,T> base)
          Constructs a new MapBasedCube.
 
Method Summary
 T get(List<E> location)
          Returns the element at the specified location.
 void put(List<E> location, T value)
          Sets the element at the specified location to the specified value.
 
Methods inherited from class net.sf.molae.pipe.cube.VaryingCube
adjustEdges, getEdgesBase, newEdge
 
Methods inherited from class net.sf.molae.pipe.cube.AbstractCube
asMap, equals, getEdge, getEdges, getProjection, hashCode, putAll, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapBasedCube

public MapBasedCube(Map<List<E>,T> base)
Constructs a new MapBasedCube.

Parameters:
base - base map

MapBasedCube

public MapBasedCube()
Constructs a new MapBasedCube.


MapBasedCube

public MapBasedCube(Cube<E,T> cube)
Constructs a new MapBasedCube that contains the values of the specified cube.

Parameters:
cube - the cube whose values are to be placed into this cube
Method Detail

get

public T get(List<E> location)
Description copied from class: AbstractCube
Returns the element at the specified location.

Specified by:
get in interface Cube<E,T>
Specified by:
get in class AbstractCube<E,T>
Parameters:
location - a list of index values that determines a position int the cube
Returns:
the element at the specified location.

put

public void put(List<E> location,
                T value)
Description copied from class: AbstractCube
Sets the element at the specified location to the specified value.

Specified by:
put in interface Cube<E,T>
Specified by:
put in class AbstractCube<E,T>
Parameters:
location - a list of index values that determines a position int the cube
value - new value of the cell at the specified location