|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Cube
Cube
A Cube
instance corresponds to a PALO cube. Data can be
read from and stored to a PALO cube.
A reference to this owner Database
is obtained by
invoking getDatabase()
.
A Cube
is associated with a number of Dimension
s.
These Dimension
s must belong to the same parent Database
as the cube. (The cube's dimensions are thus a subset of the parent database's dimensions.)
PaloAPIException
Field Summary | |
---|---|
static int |
CUBEEXTENDEDTYPE_REGULAR
Constants for cube-type |
static int |
CUBEEXTENDEDTYPE_VIRTUAL
Constants for cube-type |
static int |
SPLASHMODE_BASE_ADD
Splash-mode constant enumeration. |
static int |
SPLASHMODE_BASE_SET
Splash-mode constant enumeration. |
static int |
SPLASHMODE_DEFAULT
Splash-mode constant enumeration. |
static int |
SPLASHMODE_DISABLED
Splash-mode constant to disable splashing of a consolidated cell. |
static int |
SPLASHMODE_UNKNOWN
Splash-mode constant enumeration. |
Fields inherited from interface org.palo.api.PaloObject |
---|
TYPE_ATTRIBUTE, TYPE_NORMAL, TYPE_SYSTEM, TYPE_USER_INFO |
Method Summary | |
---|---|
CubeView |
addCubeView(java.lang.String name,
Property[] properties)
Adds a new cube view to this cube. |
CubeView |
addCubeView(java.lang.String id,
java.lang.String name,
Property[] properties)
Deprecated. please use addCubeView(String, Property[]) instead |
void |
addDataArray(Element[][] coordinates,
java.lang.Object[] values,
int splashMode)
Adds the given values to the existing values of the specified cells. |
void |
addProperty(Property2 property)
Adds the given property to the list of properties for this cube. |
Rule |
addRule(java.lang.String definition)
Adds the given rule definition to this cube instance |
Rule |
addRule(java.lang.String definition,
java.lang.String externalIdentifier,
boolean useIt,
java.lang.String comment)
Adds the given rule definition to this cube instance |
Rule |
addRule(java.lang.String definition,
java.lang.String externalIdentifier,
boolean useIt,
java.lang.String comment,
boolean activate)
Adds the given rule definition to this cube instance |
void |
clear()
Clears the complete cube, i.e. all its cells are cleared |
void |
clear(Element[][] area)
Clears the cube data specified by the given area. |
void |
commitLog()
Commits all setdata operations (logged in .cube.log) to the cube data file (.cube.data). |
java.lang.String[] |
getAllPropertyIds()
Returns all ids of properties that can be set for this cube. |
Cell |
getCell(Element[] coordinate)
Returns the Cell object for the given cube coordinate. |
Cell[] |
getCellArea(Element[][] coordinates)
Returns the Cell objects for the cube area which is defined by
the cartesian product of the given Element coordinates. |
java.math.BigInteger |
getCellCount()
Returns the total number of Cell s this cube contains. |
Cell[] |
getCells(Element[][] coordinates)
Returns the Cell objects for the given cube coordinates. |
CubeView |
getCubeView(java.lang.String id)
Returns the cube view which is registered with the given id or null if no such view exists. |
int |
getCubeViewCount()
Returns the number of views which are registered with this Cube . |
java.lang.String[] |
getCubeViewIds()
Returns the ids of all registered CubeView s |
java.lang.String |
getCubeViewName(java.lang.String id)
Rturns the name of the CubeView which corresponds to the
given id or null if no corresponding view exists |
CubeView[] |
getCubeViews()
Deprecated. please use getCubeViews(PersistenceObserver) instead |
void |
getCubeViews(PersistenceObserver observer)
|
java.lang.Object |
getData(Element[] coordinates)
Returns the data stored at the given coordinates. |
java.lang.Object |
getData(java.lang.String[] coordinates)
Returns the data stored at the given coordinates. |
java.lang.Object[] |
getDataArray(Element[][] elements)
Returns the data stored at the given coordinates. |
java.lang.Object[] |
getDataArray(java.lang.String[][] elements)
Returns the data stored at the cube area determined by the given element arrays. |
Database |
getDatabase()
Returns the parent Database of this instance. |
java.lang.Object[] |
getDataBulk(Element[][] coordinates)
Returns the data stored at the given coordinates. |
ExportDataset |
getDataExport(ExportContext context)
Exports the dataset using given ExportContext . |
Dimension |
getDimensionAt(int index)
Returns the Dimension stored at the given index. |
Dimension |
getDimensionById(java.lang.String id)
Returns the Dimension associated with the given identifier or
null if no such Dimension exists. |
Dimension |
getDimensionByName(java.lang.String name)
Returns the Dimension stored under the given name or
null if no such Dimension exists. |
int |
getDimensionCount()
Returns the number of Dimension s of this instance. |
Dimension[] |
getDimensions()
Returns an array of Dimension instances available
for this instance. |
ExportContext |
getExportContext()
Returns the default IExportContext which effects all cube
elements. |
ExportContext |
getExportContext(Element[][] area)
Returns an IExportContext which effects only the cube
elements which are specified by the given area paramter |
int |
getExtendedType()
Returns the extended-type of this Cube . |
java.math.BigInteger |
getFilledCellCount()
Returns the number of filled Cell s this cube contains. |
java.lang.String |
getName()
Returns the name of this Cube |
Property2 |
getProperty(java.lang.String id)
Returns the property identified by the given id. |
Rule |
getRule(Element[] coordinate)
Returns the rule which determines the value of the cell specified by the given coordinate or null if no rule was defined for this cell |
Rule[] |
getRules()
Returns all rules which are defined for the current cube |
int |
getType()
Returns the type of this cube. |
boolean |
isAttributeCube()
Checks if this Cube is an attribute cube, i.e. |
boolean |
isSubsetCube()
Checks if this Cube is a subset cube, i.e. |
boolean |
isSystemCube()
Signals if this Cube instance represents a so called system
cube. |
boolean |
isUserInfoCube()
Signals if this Cube instance represents a so called user
info cube. |
boolean |
isViewCube()
Checks if this Cube is a view cube, i.e. |
void |
registerViewObserver(PersistenceObserver cubeViewObserver)
Deprecated. please use getCubeViews(PersistenceObserver) instead |
void |
removeCubeView(CubeView view)
Removes the given cube view instance from the cube |
void |
removeProperty(java.lang.String id)
Removes the given property from the list of properties for this cube. |
boolean |
removeRule(Rule rule)
Removes the given rule from this cube instance |
boolean |
removeRule(java.lang.String ruleId)
Removes the rule which corresponds to the given id from this cube instance. |
void |
rename(java.lang.String newName)
Renames this Cube . |
void |
setData(Element[] coordinates,
java.lang.Object value)
Sets the data for the given coordinates. |
void |
setData(Element[] coordinate,
java.lang.Object value,
java.text.NumberFormat formatter)
Deprecated. PLEASE DON'T USE! SUBJECT TO CHANGE! |
void |
setData(java.lang.String[] coordinates,
java.lang.Object value)
Sets the data for the given coordinates. |
void |
setDataArray(Element[][] coordinates,
java.lang.Object[] values,
boolean add,
int splashMode,
boolean notifyEventProcessors)
Sets the data for multiple cells, specified by the given coordinates. |
void |
setDataArray(Element[][] coordinates,
java.lang.Object[] values,
int splashMode)
Sets the data for multiple cells, specified by the given coordinates. |
void |
setDataSplashed(Element[] coordinate,
java.lang.Object value)
Sets the data for the given coordinate. |
void |
setDataSplashed(Element[] coordinates,
java.lang.Object value,
int splashMode)
Sets the data for the given coordinates. |
void |
setDataSplashed(Element[] coordinate,
java.lang.Object value,
java.text.NumberFormat formatter)
Deprecated. PLEASE DON'T USE! SUBJECT TO CHANGE! |
void |
setDataSplashed(java.lang.String[] coordinates,
java.lang.Object value,
int splashMode)
Sets the data for the given coordinates. |
void |
unregisterViewObserver(PersistenceObserver cubeViewObserver)
Deprecated. please use getCubeViews(PersistenceObserver) instead |
Methods inherited from interface org.palo.api.PaloObject |
---|
getId |
Methods inherited from interface org.palo.api.Writable |
---|
canBeModified, canCreateChildren |
Field Detail |
---|
static final int SPLASHMODE_DISABLED
static final int SPLASHMODE_DEFAULT
static final int SPLASHMODE_BASE_ADD
static final int SPLASHMODE_BASE_SET
static final int SPLASHMODE_UNKNOWN
static final int CUBEEXTENDEDTYPE_REGULAR
static final int CUBEEXTENDEDTYPE_VIRTUAL
Method Detail |
---|
int getExtendedType()
Cube
.
Cube
.java.lang.String getName()
Cube
getName
in interface NamedEntity
Cube
.Database getDatabase()
Database
of this instance.
Database
of this instance.int getDimensionCount()
Dimension
s of this instance.
Dimension
s of this instance.Dimension getDimensionAt(int index)
Dimension
stored at the given index.
If the index does not correspond to a legal position
in the internally managed array of dimensions of this
instance, then null
is returned.
index
- the index
Dimension
stored at the given index
or null
.Dimension[] getDimensions()
Dimension
instances available
for this instance.
The returned array is a copy of the internal data structure. Changing the returned array does not change this instance.
Dimension
instances available
for this connection.Dimension getDimensionByName(java.lang.String name)
Dimension
stored under the given name or
null
if no such Dimension
exists.
name
- the dimension-name to look-up.
Dimension
stored under the given name or
null
if no such Dimension
exists.Dimension getDimensionById(java.lang.String id)
Dimension
associated with the given identifier or
null
if no such Dimension
exists.
id
- the id of the dimension to look-up.
Dimension
stored under the given id or
null
if no such Dimension
exists.void commitLog()
java.lang.Object getData(java.lang.String[] coordinates)
A valid coordinates specification must meet the following criteria:
The coordinates array length must the equal to the dimension-count of the cube
The entry in the coordinates array at position
i
must be the name of an element of the dimension
that is stored at position i
in the cube (
as returned by getDimensions()
).
coordinates
- the coordinate array identifying the
data cell.
java.lang.Object[] getDataArray(java.lang.String[][] elements)
The element arrays must meet the following criteria:
The first dimension of the elements array must have the same length as the number of dimensions in this cube.
Each of the String arrays in the second dimension
of the elements array must consist of one or more element
names that belong to an element in the dimension of
this cube that is stored at the some position (
as returned by getDimensions()
.
The number of returned elements is determined by the cartesian product of the given string-arrays.
Example: Suppose you have a cube with 3 dimensions which have the following names and elements.
"Dim1" with elements "a1", "a2", "a3"
"Dim2" with elements "b1", "b2", "b3", "b4",
"Dim3" with elements "c1", "c2", "c3"
getDimensions()
on the cube.
The following query
cube.getDataArray(new String[][] { new String[] { "a1", "a2" }, // 2 elements new String[] { "b1", "b2" }, // 2 elements new String[] { "c1" }, // 1 element });would return 2 * 2 * 1 = 4 results. Which correspond to the coordinates
("a1", "b1", "c1" ), ("a2", "b1", "c1" ), ("a1", "b2", "c1" ), ("a2", "b2", "c1" )A second example shows the definition of a cell area:
cube.getDataArray(new String[][] { new String[] { "a1", "a2", "a3" }, // 3 elements new String[] { "b1", "b2", "b3" }, // 3 elements new String[] { "c1" }, // 1 element });would return 3 * 3 * 1 = 9 results. Which correspond to the coordinates
("a1", "b1", "c1" ), ("a2", "b1", "c1" ), ("a3", "b1", "c1" ), ("a1", "b2", "c1" ), ("a2", "b2", "c1" ), ("a3", "b2", "c1" ), ("a1", "b3", "c1" ), ("a3", "b3", "c1" ), ("a3", "b3", "c1" )(The above sequence is from left to right and top to bottom)
elements
- an array of string arrays that specifies
the data to read.
java.lang.Object getData(Element[] coordinates)
Element
instance. This method is similar
to getData(String[])
, the only difference is that the
coordinates are now specified as element instances and not as
names of elements. All preconditions of getData(String[])
apply to this method as well.
coordinates
- the coordinate array identifying the
data cell.
java.lang.Object[] getDataArray(Element[][] elements)
Element
instance. This method is similar
to getDataArray(String[][])
, the only difference is that the
coordinates are now specified as element instances and not as
names of elements. All preconditions of getDataArray(String[][])
apply to this method as well. getDataBulk(Element[][])
.
elements
- an array of Element
-arrays that specifies
the data to read.
data cell.
getDataArray(String[][])
,
getDataBulk(Element[][])
java.lang.Object[] getDataBulk(Element[][] coordinates)
Element
instances. This method behaves differently
from getDataArray(Element[][])
because it returns only the
values from those cells which are specified, i.e. no area could be
defined
coordinates
- an array of Element
-coordinates that specifies
the data to read.
void setData(java.lang.String[] coordinates, java.lang.Object value)
coordinates
- the string array identifying the
data cell.value
- the value to set, the type of the value must
match the element-type.void setData(Element[] coordinates, java.lang.Object value)
Element
instance.
Consolidated coordinates will not allow writing of data.
coordinates
- the Element
array identifying the
data cell.value
- the value to set, the type of the value must
match the element-type.void setDataSplashed(Element[] coordinate, java.lang.Object value)
Following splash parameters are supported:
sets the consolidated value to specified value. Used splashmode is SPLASHMODE_DEFAULT
adds the given percent value to the consolidated value. Used splashmode is SPLASHMODE_DEFAULT
adds the given value to all base cells of this consolidated cell. Used splashmode is SPLASHMODE_BASE_ADD
sets value of all base cells to the given value. Used splashmode is SPLASHMODE_BASE_SET
As an example a specified value of #100 would set the consolidated cell value to 100 and distribute this to all its base cells according to their weights. An additional #19% would set the consolidated cell value to 119 and adjust the base cells accordingly.
If given value was not prefixed with a splash parameter
SPLASHMODE_DEFAULT
is used as splash mode. In this case
calling this method is equal to
setDataSplashed(Element[], Object, int)
coordinate
- the cell coordinatevalue
- the value to set optional prefixed by a splash parameter.void setDataSplashed(Element[] coordinate, java.lang.Object value, java.text.NumberFormat formatter)
Following splash parameters are supported:
sets the consolidated value to specified value. Used splashmode is SPLASHMODE_DEFAULT
adds the given percent value to the consolidated value. Used splashmode is SPLASHMODE_DEFAULT
adds the given value to all base cells of this consolidated cell. Used splashmode is SPLASHMODE_BASE_ADD
sets value of all base cells to the given value. Used splashmode is SPLASHMODE_BASE_SET
As an example a specified value of #100 would set the consolidated cell value to 100 and distribute this to all its base cells according to their weights. An additional #19% would set the consolidated cell value to 119 and adjust the base cells accordingly.
If given value was not prefixed with a splash parameter
SPLASHMODE_DEFAULT
is used as splash mode. In this case
calling this method is equal to
setDataSplashed(Element[], Object, int)
coordinate
- the cell coordinatevalue
- the value to set optional prefixed by a splash parameter.formatter
- the NumberFormat
to use to format the value.
If null
is specified no formatting is applied.void setData(Element[] coordinate, java.lang.Object value, java.text.NumberFormat formatter)
void setDataSplashed(java.lang.String[] coordinates, java.lang.Object value, int splashMode)
setData(String[], Object)
except
that the splashing behavior is explicitly specified.
The splashMode parameter must be set to one of the constants
defined in the Cube
class.
coordinates
- the string array identifying the
data cell.value
- the value to set, the type of the value must
match the element-type.splashMode
- the splashMode to use.void setDataSplashed(Element[] coordinates, java.lang.Object value, int splashMode)
setData(String[], Object)
except
that the splashing behavior is explicitly specified.
The splashMode parameter must be set to one of the constants
defined in the Cube
class.
coordinates
- the Element
array identifying the
data cell.value
- the value to set, the type of the value must
match the element-type.splashMode
- the splashMode to use.void setDataArray(Element[][] coordinates, java.lang.Object[] values, int splashMode)
Note that this method is not the opposite of getDataArray() since it does not expect a defined area of cells. Instead each cell must be defined by a coordinate as an array of elements.
coordinates
- an array of Element
coordinates which identify
each cellvalues
- the cell values to setsplashMode
- the splashing mode to useboolean isAttributeCube()
Cube
is an attribute cube, i.e.
its cells represent Attribute
values.
boolean isSubsetCube()
Cube
is a subset cube, i.e.
its cells represent Subset
definitions.
boolean isViewCube()
Cube
is a view cube, i.e.
its cells represent CubeView
definitions.
CubeView addCubeView(java.lang.String id, java.lang.String name, Property[] properties)
addCubeView(String, Property[])
instead
Note: if a view with the given id was already added before this
method throws an PaloAPIException
id
- an unique identifier for the new viewname
- the view nameproperties
- array of Property objects for the cube view.
CubeView addCubeView(java.lang.String name, Property[] properties)
#addCubeView(String, String, boolean)
.
name
- the view nameproperties
- array of Property objects for the cube view.
void removeCubeView(CubeView view)
view
- the cube view to remove
PaloObjectNotFoundException
- if corresponding palo object could
not be foundCubeView getCubeView(java.lang.String id) throws PaloIOException
null
if no such view exists.
id
- identifier of the view to load
null
PaloIOException
- to signal the occurrence of errors during
loading of CubeView
java.lang.String[] getCubeViewIds()
CubeView
s
java.lang.String getCubeViewName(java.lang.String id)
CubeView
which corresponds to the
given id or null
if no corresponding view exists
id
- a valid view identifier
CubeView
name or null
int getCubeViewCount()
Cube
.
Cube
CubeView[] getCubeViews()
getCubeViews(PersistenceObserver)
instead
registerViewObserver(PersistenceObserver)
to
monitor loading of cube views and to get notified about any errors
during the load process
CubeView
svoid getCubeViews(PersistenceObserver observer)
ExportContext getExportContext()
IExportContext
which effects all cube
elements.
ExportContext getExportContext(Element[][] area)
IExportContext
which effects only the cube
elements which are specified by the given area paramter
area
-
ExportContext
ExportDataset getDataExport(ExportContext context)
ExportContext
. If the specified
context is null
, he default context is used which effects
all cube elements.
To get the internally used context use getExportContext()
, for
the default context, or getExportContext(Element[][])
respectively.
Cell
svoid addDataArray(Element[][] coordinates, java.lang.Object[] values, int splashMode)
Note: the splash mode must be either DISABLED, DEFAULT or ADD.
coordinates
- specify the cells to add the values tovalues
- the cell value to add or setsplashMode
- either DISABLED, DEFAULT or ADDvoid setDataArray(Element[][] coordinates, java.lang.Object[] values, boolean add, int splashMode, boolean notifyEventProcessors)
The supervision server is an external process which listens to changes
within a certain area of a palo cube. For more detailed information
please refer to www.jedox.com
coordinates
- specify the cells to changevalues
- the values to set or addadd
- set to true to add the given values, to false otherwisesplashMode
- if values should be added then the splash mode has to
be either DISABLED, DEFAULT or ADDnotifyEventProcessors
- set to false to disable the notification of
the external event processors, true otherwise. Changing the default
requires admin user rights.Rule[] getRules()
Rule addRule(java.lang.String definition)
definition
- a valid rule definition
Rule addRule(java.lang.String definition, java.lang.String externalIdentifier, boolean useIt, java.lang.String comment)
definition
- a valid rule definitionexternalIdentifier
- an optional external identifieruseIt
- set to true
to use external identifier, otherwise to false
comment
- an optional comment for this rule
Rule addRule(java.lang.String definition, java.lang.String externalIdentifier, boolean useIt, java.lang.String comment, boolean activate)
definition
- a valid rule definitionexternalIdentifier
- an optional external identifieruseIt
- set to true
to use external identifier, otherwise to false
comment
- an optional comment for this ruleactivate
- specify if the added rule should be active or not
boolean removeRule(Rule rule)
rule
- the rule to remove
boolean removeRule(java.lang.String ruleId)
removeRule(Rule rule)
.
ruleId
- the identifier of the rule to delete
Rule getRule(Element[] coordinate)
null
if no rule was defined for this cell
coordinate
- the cell coordinate
null
if none was specified
PaloAPIException
- if rule loading failsboolean isSystemCube()
Cube
instance represents a so called system
cube. NOTE: native support for system cubes is only available
since palo server 1.5
true
if this cube is a system cube,
false
otherwiseboolean isUserInfoCube()
Cube
instance represents a so called user
info cube. NOTE: native support for system cubes is only available
since palo server 2.0
true
if this cube is a user info cube,
false
otherwiseint getType()
getType
in interface PaloObject
void registerViewObserver(PersistenceObserver cubeViewObserver)
getCubeViews(PersistenceObserver)
instead
PersistenceObserver
to the list of observers
which monitor the loading and saving process of cube views. The observer
will be notified about any load success or fail.
cubeViewObserver
- the PersistenceObserver
to registervoid unregisterViewObserver(PersistenceObserver cubeViewObserver)
getCubeViews(PersistenceObserver)
instead
PersistenceObserver
from the list of observers
cubeViewObserver
- the PersistenceObserver
to removevoid rename(java.lang.String newName)
Cube
.
name
- the new name for this Cube
.void clear()
void clear(Element[][] area)
Element
coordinates.
Please refer to getDataArray(String[][])
for a description of a
correct area definition.
area
- an array of coordinates which define the area of cube data
to be clearedjava.lang.String[] getAllPropertyIds()
Property2 getProperty(java.lang.String id)
id
- the id of the property to read.
void addProperty(Property2 property)
property
- the property to add.void removeProperty(java.lang.String id)
id
- the id of the property which is to be cleared.Cell getCell(Element[] coordinate)
Cell
object for the given cube coordinate.
Please note that cells are not cached by the API! Each invocation of
this method will create new cell instance!
Cell[] getCells(Element[][] coordinates)
Cell
objects for the given cube coordinates.
Please note that cells are not cached by the API! Each invocation of
this method will create new cell instances!
coordinates
- an array of Element
coordinates which
specify the cells to return
Cell[] getCellArea(Element[][] coordinates)
Cell
objects for the cube area which is defined by
the cartesian product of the given Element
coordinates.
Please note that cells are not cached by the API! Each invocation of
this method will create new cell instances!
coordinates
- an array of Element
coordinates defining
the cube area.
java.math.BigInteger getCellCount()
Cell
s this cube contains.
java.math.BigInteger getFilledCellCount()
Cell
s this cube contains.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |