|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.molae.pipe.cube.AbstractCube<E,T>
public abstract class AbstractCube<E,T>
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<Collection<? extends E>> edges)
Constructs a new AbstractCube. |
| Method Summary | ||
|---|---|---|
protected Map<List<E>,T> |
asMap()
Returns a map representation of this cube. |
|
boolean |
equals(Object o)
Compares the specified object with this cube for equality. |
|
abstract T |
get(List<E> location)
Returns the element at the specified location. |
|
protected Collection<? extends E> |
getEdge(int index)
Returns the possible index values of the specified dimension. |
|
List<Collection<? extends E>> |
getEdges()
Returns the possible index values of each dimension. |
|
Cube<E,T> |
getProjection(int index,
E pivot)
Returns a projection of this cube. |
|
int |
hashCode()
Returns the hash code value for this cube. |
|
abstract void |
put(List<E> location,
T value)
Sets the element at the specified location to the specified value. |
|
static
|
putAll(Cube<E,T> target,
Cube<E,T> 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<Collection<? extends E>> edges)
edges - the edges of this cube.protected AbstractCube()
| Method Detail |
|---|
protected Map<List<E>,T> 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 Cube<E,T>hashCode in class Objectpublic 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 Cube<E,T>equals in class Objecto - object to be compared for equality with this cube
true if the specified object is equal to this cubepublic String toString()
toString in class Objectpublic List<Collection<? extends E>> getEdges()
edges property.
getEdges in interface Cube<E,T>protected Collection<? extends E> getEdge(int index)
index - index of the requested edge
IndexOutOfBoundsException - if the index is out of range
(index < 0 || index >= getEdges().size()).public abstract T get(List<E> location)
get in interface Cube<E,T>location - a list of index values that determines a position int
the cube
NullPointerException - specified location is null.
RuntimeException - if the location is not valid
(the exact type depends on the implementation).
public abstract void put(List<E> location,
T value)
put in interface Cube<E,T>location - a list of index values that determines a position int
the cubevalue - new value of the cell at the specified location
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).
public Cube<E,T> getProjection(int index,
E pivot)
CubeProxy of this object
and calls the corresponding method of the proxy.
getProjection in interface Cube<E,T>index - 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 <E,T> void putAll(Cube<E,T> target,
Cube<E,T> source)
target - cube from which the values are readsource - cube in which the values are stored
UnsupportedOperationException - target cube is not modifiable.
RuntimeException - depending on the target cube
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||