org.palo.api.subsets.filter.settings
Class DataFilterSetting

java.lang.Object
  extended by org.palo.api.subsets.filter.settings.AbstractFilterSettings
      extended by org.palo.api.subsets.filter.settings.DataFilterSetting
All Implemented Interfaces:
FilterSetting

public class DataFilterSetting
extends AbstractFilterSettings

DataFilterSetting

Manages the settings for the DataFilter. Each data filter is based on a source cube to determine filter values for elements. A slice can be defined for this source cube. Note that the array length of this slice corresponds to the dimension count of the source cube and that the elements of e.g. slice[index] are part of the dimension which is returned by sourceCube.getDimensionAt(index)

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

Field Summary
static int ALL_OP
           
static int ANY_OP
           
static int AVG_OP
           
static int MAX_OP
           
static int MIN_OP
           
static int STR_OP
           
static int SUM_OP
           
 
Constructor Summary
DataFilterSetting(java.lang.String sourceCube)
          Creates a new DataFilterSetting instance for the given source cube.
DataFilterSetting(java.lang.String sourceCube, DataCriteria criteria)
          Creates a new DataFilterSetting instance for the given source cube and criteria.
 
Method Summary
 void adapt(FilterSetting from)
          Adapt the filter setting from the given filter setting.
 void addSliceElement(java.lang.String id)
          internally used method
 void addSliceElement(java.lang.String id, int index)
           
 void addSlicePart(ObjectParameter part)
          internally used method
 void bind(Subset2 subset)
          Binds this filter settings instance to the given Subset2 NOTE: PLEASE DON'T USE!
 void clearSlice()
           
 IntegerParameter getCellOperator()
          Returns the cell operator to use, i.e. one of the predefined operator constants.
 DataCriteria getCriteria()
          Returns the currently used data criteria
 DoubleParameter getLowerPercentage()
          Returns the percentage of all lower elements to select
 java.lang.String[][] getSlice()
          Returns the element ids which should be used for the slice.
 ObjectParameter[] getSliceParameters()
          Returns an ObjectParameter array which contains the currently used slice of the source cube.
 ObjectParameter getSlicePart()
          internally used method
 ObjectParameter getSlicePart(int index)
          Returns the slice part for the given dimension index.
 StringParameter getSourceCube()
          Returns the identifier of the source cube of this data filter
 IntegerParameter getTop()
          Returns the number of top elements to select
 DoubleParameter getUpperPercentage()
          Returns the percentage of all upper elements to select
 BooleanParameter getUseRules()
          Checks if an existing rule should be used to determine element value.
 void reset()
          Resets the filter setting to its defaults.
 void setCellOperator(int cellOperator)
          Sets the cell operator.
 void setCellOperator(IntegerParameter cellOperator)
          Sets the cell operator, i.e. the parameter value should be one of the predefined operator constants.
 void setCriteria(DataCriteria criteria)
          Sets the data criteria to use
 void setLowerPercentage(double lowerPercentage)
          Sets the percentage of all lower elements to select
 void setLowerPercentage(DoubleParameter lowerPercentage)
           
 void setSliceElements(java.lang.String[] ids, int index)
           
 void setSourceCube(java.lang.String sourceCube)
          Sets the identifier of the source cube to use
 void setSourceCube(StringParameter sourceCube)
          Sets the identifier of the source cube to use, i.e. the parameter value should contain the id of the source cube.
 void setTop(int top)
          Sets the number of top elements to select
 void setTop(IntegerParameter top)
          Sets the top count, i.e. the parameter value should contain the number of elements to select.
 void setUpperPercentage(double upperPercentage)
          Specifies the percentage of all upper elements to select
 void setUpperPercentage(DoubleParameter upperPercentage)
          Specifies the percentage of all upper elements to select, i.e. the parameter value contains the p
 void setUseRules(boolean useRules)
          Specifies if an existing rule should be used to determine the element value.
 void setUseRules(BooleanParameter useRules)
          Specifies if an existing rule should be used to determine the element value.
 void unbind()
          Releases this filter settings instance from a previously binded Subset2 NOTE: PLEASE DON'T USE!
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUM_OP

public static final int SUM_OP
See Also:
Constant Field Values

ALL_OP

public static final int ALL_OP
See Also:
Constant Field Values

AVG_OP

public static final int AVG_OP
See Also:
Constant Field Values

MAX_OP

public static final int MAX_OP
See Also:
Constant Field Values

ANY_OP

public static final int ANY_OP
See Also:
Constant Field Values

MIN_OP

public static final int MIN_OP
See Also:
Constant Field Values

STR_OP

public static final int STR_OP
See Also:
Constant Field Values
Constructor Detail

DataFilterSetting

public DataFilterSetting(java.lang.String sourceCube)
Creates a new DataFilterSetting instance for the given source cube. DataCriteria.GREATER is used as default criteria.

Parameters:
sourceCube - a valid identifier of the source cube to use

DataFilterSetting

public DataFilterSetting(java.lang.String sourceCube,
                         DataCriteria criteria)
Creates a new DataFilterSetting instance for the given source cube and criteria.

Parameters:
sourceCube - a valid identifier of the source cube to use
criteria - the data criteria to use
Method Detail

getTop

public final IntegerParameter getTop()
Returns the number of top elements to select

Returns:
the number of top elements

setTop

public final void setTop(int top)
Sets the number of top elements to select

Parameters:
top - the new number of top elements

setTop

public final void setTop(IntegerParameter top)
Sets the top count, i.e. the parameter value should contain the number of elements to select.

Parameters:
top - the new IntegerParameter which specifies the number of top elements to select

getCellOperator

public final IntegerParameter getCellOperator()
Returns the cell operator to use, i.e. one of the predefined operator constants.

Returns:
the cell operator

setCellOperator

public final void setCellOperator(int cellOperator)
Sets the cell operator. One of the predefined operator constants should be used

Parameters:
cellOperator - the new cell operator

setCellOperator

public final void setCellOperator(IntegerParameter cellOperator)
Sets the cell operator, i.e. the parameter value should be one of the predefined operator constants.

Parameters:
cellOperator - the new IntegerParameter which specifies the cell operator

setCriteria

public final void setCriteria(DataCriteria criteria)
Sets the data criteria to use

Parameters:
criteria - the new data criteria

getCriteria

public final DataCriteria getCriteria()
Returns the currently used data criteria

Returns:
the used data criteria

setUseRules

public final void setUseRules(boolean useRules)
Specifies if an existing rule should be used to determine the element value. Has only effect if corresponding cube cell has a rule.

Parameters:
useRules - set to true to use existing rule for determining element value, to false otherwise

setUseRules

public final void setUseRules(BooleanParameter useRules)
Specifies if an existing rule should be used to determine the element value. Has only effect if corresponding cube cell has a rule.

Parameters:
useRules - the new BooleanParameter to use

getUseRules

public final BooleanParameter getUseRules()
Checks if an existing rule should be used to determine element value.

Returns:
true if rule should be used, false otherwise

getSourceCube

public final StringParameter getSourceCube()
Returns the identifier of the source cube of this data filter

Returns:
the source cube id

setSourceCube

public final void setSourceCube(java.lang.String sourceCube)
Sets the identifier of the source cube to use

Parameters:
sourceCube - the source cube id

setSourceCube

public final void setSourceCube(StringParameter sourceCube)
Sets the identifier of the source cube to use, i.e. the parameter value should contain the id of the source cube.

Parameters:
sourceCube - the new StringParameter to use as source cube

getUpperPercentage

public final DoubleParameter getUpperPercentage()
Returns the percentage of all upper elements to select

Returns:
the upper percentage

setUpperPercentage

public final void setUpperPercentage(double upperPercentage)
Specifies the percentage of all upper elements to select

Parameters:
upperPercentage - the new upper percentage

setUpperPercentage

public final void setUpperPercentage(DoubleParameter upperPercentage)
Specifies the percentage of all upper elements to select, i.e. the parameter value contains the p

Parameters:
upperPercentage -

getLowerPercentage

public final DoubleParameter getLowerPercentage()
Returns the percentage of all lower elements to select

Returns:
the lower percentage

setLowerPercentage

public final void setLowerPercentage(double lowerPercentage)
Sets the percentage of all lower elements to select

Parameters:
lowerPercentage - the new lower percentage

setLowerPercentage

public final void setLowerPercentage(DoubleParameter lowerPercentage)

getSliceParameters

public final ObjectParameter[] getSliceParameters()
Returns an ObjectParameter array which contains the currently used slice of the source cube. The length of the slice array corresponds to the number of dimensions of the source cube. Each slice entry contains a ObjectParameter with a string array as its value. This array holds the ids of the elements which should be used for the slice at the current dimension.

Returns:
the current slice parameter

getSlice

public final java.lang.String[][] getSlice()
Returns the element ids which should be used for the slice. NOTE: if the id array has a length of 1 and the only id is either -1 or * then all elements of the corresponding dimension should be taken.

Returns:

addSliceElement

public final void addSliceElement(java.lang.String id,
                                  int index)

setSliceElements

public final void setSliceElements(java.lang.String[] ids,
                                   int index)

getSlicePart

public final ObjectParameter getSlicePart(int index)
Returns the slice part for the given dimension index.

Returns:
See Also:
#addNextSliceDimension(), addSliceElement(String);

clearSlice

public final void clearSlice()

addSlicePart

public final void addSlicePart(ObjectParameter part)
internally used method


getSlicePart

public final ObjectParameter getSlicePart()
internally used method


addSliceElement

public final void addSliceElement(java.lang.String id)
internally used method


reset

public final void reset()
Description copied from interface: FilterSetting
Resets the filter setting to its defaults.


bind

public final void bind(Subset2 subset)
Description copied from interface: FilterSetting

Binds this filter settings instance to the given Subset2

NOTE: PLEASE DON'T USE! INTERNAL METHOD

Specified by:
bind in interface FilterSetting
Overrides:
bind in class AbstractFilterSettings

unbind

public final void unbind()
Description copied from interface: FilterSetting

Releases this filter settings instance from a previously binded Subset2

NOTE: PLEASE DON'T USE! INTERNAL METHOD

Specified by:
unbind in interface FilterSetting
Overrides:
unbind in class AbstractFilterSettings

adapt

public final void adapt(FilterSetting from)
Description copied from interface: FilterSetting
Adapt the filter setting from the given filter setting. After that both settings are the same.

Parameters:
from - the filter setting to adapt from