com.espertech.esper.view.stat.olap
Interface MultidimCube<V>

All Known Implementing Classes:
MultidimCubeImpl

public interface MultidimCube<V>

Interface for storage and access to multi-dimensional data. Implementations store cells for each of multiple dimensions. Implementations have a configurable number of dimensions, and the number of dimensions doesn't change. Cell objects are supplied via the template. The identification of a cell in the cube occurs by member values for each dimension. The MultiKeyUntyped class is used to supply these member values for all dimensions, also referred to as coordinates. Each Object in the MultiKeyUntyped is the (new or existng) member of a single dimension. Implementations typically supports 1 to an unlimited number of dimensions. Implementations can typically grows the members in each dimension as new dimension members become known. The members of each dimension can be supplied via a setter method. This is an example of a 2-dimensional cube. The numbers in [] brackets are indizes per dimension, ie. [n,m] where n=dimension zero index and m=dimension one index. The number in each cell is the ordinal between 0 and 11. a b c d === === === === x [0,0] 0 [1,0] 1 [2,0] 2 [3,0] 3 y 4 5 6 [3,1] 7 z 8 9 10 [3,2] 11 Example: looking for (d,y) yields [3,1] with ordinal 7.


Method Summary
 V getCell(MultiKeyUntyped coordinates)
          Get a cell, returns null if the cell does not yet exist.
 V getCellAddMembers(MultiKeyUntyped coordinates)
          Get a cell adding the coordinate members if the cell does not yet exist.
 V[] getCells()
          Returns all cells.
 String[] getDimensionNames()
          Returns array containing name of each dimension including the name of the cell.
 List<Object> getMembers(int dimension)
          Get the members making up a dimension.
 int getNumDimensions()
          Get the number of dimensions of the cube.
 void setMembers(int dimension, Class enumType)
          Set dimension members from the enumeration Class.
 void setMembers(int dimension, List<Object> members)
          Set dimension members from the list of value objects.
 

Method Detail

getNumDimensions

int getNumDimensions()
Get the number of dimensions of the cube. The minimum number of dimensions is 1.

Returns:
number of dimensions

getDimensionNames

String[] getDimensionNames()
Returns array containing name of each dimension including the name of the cell. The array size is getNumDimensions() + 1, with the first element as the cell name.

Returns:
dimension names array

setMembers

void setMembers(int dimension,
                Class enumType)
Set dimension members from the enumeration Class.

Parameters:
dimension - starts at 0 and has a max of number of dimensions minus 1
enumType - is the class for which the enum constants are obtained, and used as members

setMembers

void setMembers(int dimension,
                List<Object> members)
Set dimension members from the list of value objects.

Parameters:
dimension - starts at 0 and has a max of number of dimensions minus 1
members - is a list of objects making up the dimension member values

getMembers

List<Object> getMembers(int dimension)
Get the members making up a dimension.

Parameters:
dimension - for which to return the members
Returns:
list of member object of the dimension

getCell

V getCell(MultiKeyUntyped coordinates)
Get a cell, returns null if the cell does not yet exist.

Parameters:
coordinates - contains member values for each dimension of the cube
Returns:
the cell

getCellAddMembers

V getCellAddMembers(MultiKeyUntyped coordinates)
Get a cell adding the coordinate members if the cell does not yet exist.

Parameters:
coordinates - contains member values for each dimension of the cube
Returns:
the cell

getCells

V[] getCells()
Returns all cells.

Returns:
cell array

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com