|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.sf.molae.pipe.cube.AbstractCube
Skeleton implementation of the cube interface.
Only the get and set methods have to be
implemented.
| Constructor Summary | |
protected |
AbstractCube()
Constructs a new AbstractCube. |
protected |
AbstractCube(List edges)
Constructs a new AbstractCube. |
| Method Summary | |
protected Map |
asMap()
Returns a map representation of this cube. |
boolean |
equals(Object o)
Compares the specified object with this cube for equality. |
abstract Object |
get(List location)
Returns the element at the specified location. |
protected Collection |
getEdge(int index)
Returns the possible index values of the specified dimension. |
List |
getEdges()
Returns the possible index values of each dimension. |
Cube |
getProjection(int index,
Object pivot)
Returns a projection of this cube. |
int |
hashCode()
Returns the hash code value for this cube. |
abstract void |
put(List location,
Object value)
Sets the element at the specified location to the specified value. |
static void |
putAll(Cube target,
Cube source)
Copies all values from the source cube to the target cube. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected AbstractCube(List edges)
edges - the edges of this cube.protected AbstractCube()
| Method Detail |
protected Map asMap()
public int hashCode()
Cubec is defined to be
new CubeAsMap(c).hashCode().
This ensures that c1.equals(c2) implies that
c1.hashCode()==c2.hashCode() for any two cubes
c1 and c2,
as required by the general contract of Object.hashCode.hashCode in interface CubehashCode in class Objectnet.sf.molae.pipe.cube.Cubepublic boolean equals(Object o)
Cubetrue if the given object is also a cube
and the two Cubes represent the same mappings.
More formally, two cubes c1 and c2
represent the same mappings if
new CubeAsMap(c1).equals(new CubeAsMap(c2)).
This ensures that the equals method works properly across
different implementations of the Cube interface.equals in interface Cubeequals in class Objectnet.sf.molae.pipe.cube.Cubeo - object to be compared for equality with this cubetrue if the specified object is equal to this cubepublic String toString()
toString in class Objectpublic List getEdges()
edges property.getEdges in interface Cubeprotected Collection getEdge(int index)
index - index of the requested edgeIndexOutOfBoundsException - if the index is out of range
(index < 0 || index >= getEdges().size()).public abstract Object get(List location)
get in interface Cubelocation - a list of index values that determines a position int
the cubeNullPointerException - specified location is null.RuntimeException - if the location is not valid
(the exact type depends on the implementation).
public abstract void put(List location,
Object value)
put in interface Cubelocation - a list of index values that determines a position int
the cubevalue - new value of the cell at the specified locationUnsupportedOperationException - 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).
public Cube getProjection(int index,
Object pivot)
CubeProxy of this object
and calls the corresponding method of the proxy.getProjection in interface Cubeindex - the dimension that will be fixed.pivot - the fixed value of the fixed dimension.IndexOutOfBoundsException - if the index is out of range
(index < 0 || index >= getEdges().size()).
public static void putAll(Cube target,
Cube source)
target - cube from which the values are readsource - cube in which the values are storedUnsupportedOperationException - target cube is not modifiable.RuntimeException - depending on the target cube
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||