net.sf.molae.pipe.cube
Class MapBasedCube

java.lang.Object
  |
  +--net.sf.molae.pipe.cube.AbstractCube
        |
        +--net.sf.molae.pipe.cube.VaryingCube
              |
              +--net.sf.molae.pipe.cube.MapBasedCube
All Implemented Interfaces:
Cube

public class MapBasedCube
extends VaryingCube

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 cube)
          Constructs a new MapBasedCube that contains the values of the specified cube.
MapBasedCube(Map base)
          Constructs a new MapBasedCube.
 
Method Summary
 Object get(List location)
          Returns the element at the specified location.
 void put(List location, Object 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 base)
Constructs a new MapBasedCube.
Parameters:
base - base map

MapBasedCube

public MapBasedCube()
Constructs a new MapBasedCube.

MapBasedCube

public MapBasedCube(Cube 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 Object get(List location)
Description copied from class: AbstractCube
Returns the element at the specified location.
Overrides:
get in class AbstractCube
Following copied from class: net.sf.molae.pipe.cube.AbstractCube
Parameters:
location - a list of index values that determines a position int the cube
Returns:
the element at the specified location.
Throws:
NullPointerException - specified location is null.
RuntimeException - if the location is not valid (the exact type depends on the implementation).

put

public void put(List location,
                Object value)
Description copied from class: AbstractCube
Sets the element at the specified location to the specified value.
Overrides:
put in class AbstractCube
Following copied from class: net.sf.molae.pipe.cube.AbstractCube
Parameters:
location - a list of index values that determines a position int the cube
value - new value of the cell at the specified location
Throws:
UnsupportedOperationException - if this cube is not modifiable.
NullPointerException - specified location is null.
RuntimeException - if the location is not valid (the exact type depends on the implementation).