org.palo.api.subsets.filter
Class DataFilter

java.lang.Object
  extended by org.palo.api.subsets.filter.DataFilter
All Implemented Interfaces:
EffectiveFilter, RestrictiveFilter, SubsetFilter

public class DataFilter
extends java.lang.Object
implements RestrictiveFilter, EffectiveFilter

DataFilter

A data filter is a restrictive filter as well as an affective filter. It is restrictive in the sense that elements which go into the subset can be filtered out based on their corresponding cell values of a selected source cube. It is affective in the sense that this filter can influence the SortingFilter.

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

Field Summary
 
Fields inherited from interface org.palo.api.subsets.SubsetFilter
TYPE_ALIAS, TYPE_ATTRIBUTE, TYPE_DATA, TYPE_HIERARCHICAL, TYPE_PICKLIST, TYPE_SORTING, TYPE_TEXT
 
Constructor Summary
DataFilter(Dimension dimension, DataFilterSetting setting)
          Deprecated. use DataFilter(Hierarchy, DataFilterSetting) instead.
DataFilter(Dimension dimension, java.lang.String sourceCube)
          Deprecated. use DataFilter(Hierarchy, String) instead.
DataFilter(Hierarchy hierarchy, DataFilterSetting setting)
          Creates a new DataFilter instance for the given hierarchy with the given settings
DataFilter(Hierarchy hierarchy, java.lang.String sourceCube)
          Creates a new DataFilter instance for the given hierarchy
 
Method Summary
 void adapt(SubsetFilter from)
          Adapts this subset filter from the given one.
 void add(EffectiveFilter filter)
          Adds the given EffectiveFilter to the list of all affective filters which affect this subset filter
 void bind(Subset2 subset)
          Binds this filter instance to the given Subset2 NOTE: PLEASE DON'T USE!
 DataFilter copy()
          Creates a deep copy of this subset filter
 void filter(java.util.Set<Element> elements)
          Filters the given list of Elements.
 Dimension getDimension()
           
 int[] getEffectiveFilter()
          Returns the filter types which are affected by this filter.
 Hierarchy getHierarchy()
          Convenient method to access the subset hierarchy.
 DataFilterSetting getSettings()
          Returns the internal settings of this filter.
 Subset2 getSubset()
          Returns the Subset2 to which this filter belongs or null if this filter isn't bind to a subset yet.
 int getType()
          Returns the filter type which is one of the defined type constants.
 void initialize()
          Initializes this filter.
 void remove(EffectiveFilter filter)
          Removes the given EffectiveFilter from the list of all affective filters which affect this subset filter
 void reset()
          Resets this filter, i.e. its internal setting is switched back to its default.
 void unbind()
          Releases this filter instance from a previously binded Subset2 NOTE: PLEASE DON'T USE!
 void validateSettings()
          Checks if the internal subset settings are valid.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.palo.api.subsets.SubsetFilter
adapt, add, bind, getHierarchy, getSubset, remove, reset, unbind
 

Constructor Detail

DataFilter

public DataFilter(Dimension dimension,
                  java.lang.String sourceCube)
Deprecated. use DataFilter(Hierarchy, String) instead.

Creates a new DataFilter instance for the given dimension

Parameters:
dimension - the dimension to create the filter for

DataFilter

public DataFilter(Hierarchy hierarchy,
                  java.lang.String sourceCube)
Creates a new DataFilter instance for the given hierarchy

Parameters:
hierarchy - the hierarchy to create the filter for

DataFilter

public DataFilter(Dimension dimension,
                  DataFilterSetting setting)
Deprecated. use DataFilter(Hierarchy, DataFilterSetting) instead.

Creates a new DataFilter instance for the given dimension with the given settings

Parameters:
dimension - the dimension to create the filter for
setting - the filter settings to use

DataFilter

public DataFilter(Hierarchy hierarchy,
                  DataFilterSetting setting)
Creates a new DataFilter instance for the given hierarchy with the given settings

Parameters:
hierarchy - the hierarchy to create the filter for
setting - the filter settings to use
Method Detail

copy

public final DataFilter copy()
Description copied from interface: SubsetFilter
Creates a deep copy of this subset filter

Specified by:
copy in interface SubsetFilter
Returns:
a copy of this subset filter

getType

public final int getType()
Description copied from interface: SubsetFilter
Returns the filter type which is one of the defined type constants.

Specified by:
getType in interface SubsetFilter
Returns:
the filter type

initialize

public final void initialize()
Description copied from interface: SubsetFilter
Initializes this filter.

Specified by:
initialize in interface SubsetFilter

getSettings

public final DataFilterSetting getSettings()
Description copied from interface: SubsetFilter
Returns the internal settings of this filter.

Specified by:
getSettings in interface SubsetFilter
Returns:

filter

public final void filter(java.util.Set<Element> elements)
Description copied from interface: RestrictiveFilter
Filters the given list of Elements.

Specified by:
filter in interface RestrictiveFilter
Parameters:
elements - current list of subset elements

getEffectiveFilter

public final int[] getEffectiveFilter()
Description copied from interface: EffectiveFilter
Returns the filter types which are affected by this filter.

Specified by:
getEffectiveFilter in interface EffectiveFilter
Returns:
the affected filter types

validateSettings

public final void validateSettings()
                            throws PaloIOException
Description copied from interface: SubsetFilter
Checks if the internal subset settings are valid.

Specified by:
validateSettings in interface SubsetFilter
Throws:
PaloIOException - if internal subset settings are not valid.

add

public final void add(EffectiveFilter filter)
Description copied from interface: SubsetFilter
Adds the given EffectiveFilter to the list of all affective filters which affect this subset filter

Specified by:
add in interface SubsetFilter
Parameters:
filter - a filter which affects this subset filter.

remove

public final void remove(EffectiveFilter filter)
Description copied from interface: SubsetFilter
Removes the given EffectiveFilter from the list of all affective filters which affect this subset filter

Specified by:
remove in interface SubsetFilter
Parameters:
filter - the affective filter to remove

reset

public final void reset()
Description copied from interface: SubsetFilter
Resets this filter, i.e. its internal setting is switched back to its default. Clears all internal used caches too.

Specified by:
reset in interface SubsetFilter

getSubset

public final Subset2 getSubset()
Description copied from interface: SubsetFilter
Returns the Subset2 to which this filter belongs or null if this filter isn't bind to a subset yet.

Specified by:
getSubset in interface SubsetFilter
Returns:
the Subset2 to which this filter belongs or null

bind

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

Binds this filter instance to the given Subset2

NOTE: PLEASE DON'T USE! INTERNAL METHOD

Specified by:
bind in interface SubsetFilter

unbind

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

Releases this filter instance from a previously binded Subset2

NOTE: PLEASE DON'T USE! INTERNAL METHOD

Specified by:
unbind in interface SubsetFilter

getDimension

public final Dimension getDimension()

getHierarchy

public final Hierarchy getHierarchy()
Description copied from interface: SubsetFilter
Convenient method to access the subset hierarchy.

Specified by:
getHierarchy in interface SubsetFilter
Returns:
the subset hierarchy

adapt

public final void adapt(SubsetFilter from)
Description copied from interface: SubsetFilter
Adapts this subset filter from the given one. Both filter must be of same type!

Specified by:
adapt in interface SubsetFilter
Parameters:
from - the subset filter to adapt from