org.palo.api
Interface ExportContext


public interface ExportContext

The interface ExportContext defines the export scope and filtering used during the data export process.

To get an instance of an ExportContext use Cube.getExportContext() or Cube.getExportContext(Element[][]) respectively. A typical scenario for tweaking the export context is to influence the elements to be exported and/or to set the filter condition to use. After setting the context a Cube#getDataExport() will export all effected cells.

Here is an example code snippet for receiving all non-consolidated elements' combinations data, where value is bigger than 1000.0

... String elements[][] = new String[cube.getDimensionCount()][]; for (int i=0; i

Version:
$Id: ExportContext.html,v 1.18 2009/07/09 11:01:46 ArndHouben Exp $

Field Summary
static java.lang.String AND
          constant for compare operator AND used for combined condition
static java.lang.String OR
          constant for compare operator OR used for combined condition
static java.lang.String XOR
          constant for compare operator XOR used for combined condition
 
Method Summary
 Condition createCondition(java.lang.String condition, double value)
          Creates a new Condition used for filtering export data.
 Condition createCondition(java.lang.String condition, java.lang.String value)
          Creates a new Condition used for filtering export data.
 int getBlocksize()
          Returns the current number of cells which are exported within one block.
 Element[][] getCellsArea()
          Returns the effected cell area
 java.lang.String getConditionRepresentation()
          Returns the internal condition representation NOTE: for internal usage only
 Element[] getExportAfter()
          Returns the element path after which the export starts NOTE: can be null if no path has be set!!
 double getProgress()
          Returns the current progress of the data export as a double value, with range between 0.0 to 1.0
 boolean ignoreEmptyCells()
          Return the ignore empty cells flag.
 boolean isBaseCellsOnly()
          Return the base cells only flag.
 boolean isUseRules()
          Returns the use rules flag value.
 void reset()
          Resets this export context, i.e. its complete state is set back to default value
 void setBaseCellsOnly(boolean baseCellsOnly)
          Filter flag to export base cells only.
 void setBlocksize(int blocksize)
          Sets the maxmimal number of cells to export within one block.
 void setCellsArea(Element[][] area)
          Sets the cell area which is effected by the export.
 void setCombinedCondition(Condition firstCondition, Condition secondCondition, java.lang.String operator)
          Sets a combined filter condition which consists of two Conditions and one of the defined boolean operator, namely OR, XOR or AND
 void setCondition(Condition condition)
          Sets the condition to use for filtering the data to export.
 void setExportAfter(Element[] path)
          Sets the element path after which the export starts.
 void setIgnoreEmptyCells(boolean ignoreEmptyCells)
          Filter flag to ignore empty cells.
 void setProgress(double progress)
          NOTE: for internal usage only
 void setUseRules(boolean useRules)
          Filter flag to export cells based on rules.
 

Field Detail

OR

static final java.lang.String OR
constant for compare operator OR used for combined condition

See Also:
Constant Field Values

XOR

static final java.lang.String XOR
constant for compare operator XOR used for combined condition

See Also:
Constant Field Values

AND

static final java.lang.String AND
constant for compare operator AND used for combined condition

See Also:
Constant Field Values
Method Detail

setBlocksize

void setBlocksize(int blocksize)
Sets the maxmimal number of cells to export within one block. The default value is 1000.

Parameters:
blocksize -

getBlocksize

int getBlocksize()
Returns the current number of cells which are exported within one block.

Returns:

setBaseCellsOnly

void setBaseCellsOnly(boolean baseCellsOnly)
Filter flag to export base cells only. If set to true only base cells are exported, use false to include all cells.

Parameters:
baseCellsOnly -

isBaseCellsOnly

boolean isBaseCellsOnly()
Return the base cells only flag.

Returns:
true if only base cells should be expported, false otherwise

setIgnoreEmptyCells

void setIgnoreEmptyCells(boolean ignoreEmptyCells)
Filter flag to ignore empty cells. If set to true empty cells are not exported.

Parameters:
ignoreEmptyCells - set true to exclude empty cells from export, use false to include

ignoreEmptyCells

boolean ignoreEmptyCells()
Return the ignore empty cells flag.

Returns:
true if empty cells are excluded from export, false otherwise

setUseRules

void setUseRules(boolean useRules)
Filter flag to export cells based on rules. If set to true only cells based on rules are exported, use false to include all cells.

Parameters:
useRules - set to true to export cells based on rules, use false to include all cells

isUseRules

boolean isUseRules()
Returns the use rules flag value.

Returns:
true if only cells based on rules should be exported, false otherwise

setCellsArea

void setCellsArea(Element[][] area)
Sets the cell area which is effected by the export.

Parameters:
area -

getCellsArea

Element[][] getCellsArea()
Returns the effected cell area

Returns:

setExportAfter

void setExportAfter(Element[] path)
Sets the element path after which the export starts. Specifying null is allowed and has the effect on a reset.

Parameters:
path - the element path or null to reset

getExportAfter

Element[] getExportAfter()
Returns the element path after which the export starts NOTE: can be null if no path has be set!!

Returns:

createCondition

Condition createCondition(java.lang.String condition,
                          double value)
Creates a new Condition used for filtering export data. To use this Condition set it via setCondition(Condition)

Parameters:
condition - one of the defined condition constants. Please refer to Condition
value - the condition value

createCondition

Condition createCondition(java.lang.String condition,
                          java.lang.String value)
Creates a new Condition used for filtering export data. To use this Condition set it via setCondition(Condition)

Parameters:
condition - one of the defined condition constants. Please refer to Condition
value - the condition value

setCondition

void setCondition(Condition condition)
Sets the condition to use for filtering the data to export.

Parameters:
condition - the filter Condition

setCombinedCondition

void setCombinedCondition(Condition firstCondition,
                          Condition secondCondition,
                          java.lang.String operator)
Sets a combined filter condition which consists of two Conditions and one of the defined boolean operator, namely OR, XOR or AND

Parameters:
firstCondition - the first filter Condition
secondCondition - the second filter Condition
operator - one of the defined boolean operator constant

getConditionRepresentation

java.lang.String getConditionRepresentation()
Returns the internal condition representation NOTE: for internal usage only

Returns:

reset

void reset()
Resets this export context, i.e. its complete state is set back to default value


getProgress

double getProgress()
Returns the current progress of the data export as a double value, with range between 0.0 to 1.0

Returns:
a double which represents current export progress.

setProgress

void setProgress(double progress)
NOTE: for internal usage only

Parameters:
progress -