org.palo.api.subsets.filter
Class TextFilter

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

public class TextFilter
extends java.lang.Object
implements RestrictiveFilter

TextFilter

A text filter belongs to the category of restrictive filters. Subset elements are filtered by textual and/or regular expressions.

Version:
$Id: TextFilter.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
TextFilter(Dimension dimension)
          Deprecated. use TextFilter(Hierarchy) instead.
TextFilter(Dimension dimension, TextFilterSetting setting)
          Deprecated. use TextFilter(Hierarchy, TextFilterSetting) instead.
TextFilter(Hierarchy hierarchy)
          Creates a new TextFilter instance for the given hierarchy
TextFilter(Hierarchy hierarchy, TextFilterSetting setting)
          Creates a new TextFilter instance for the given hierarchy with the given settings
 
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!
 TextFilter copy()
          Creates a deep copy of this subset filter
 void filter(java.util.Set<Element> elements)
          Filters the given list of Elements.
 Dimension getDimension()
           
 Hierarchy getHierarchy()
          Convenient method to access the subset hierarchy.
 TextFilterSetting 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

TextFilter

public TextFilter(Dimension dimension)
Deprecated. use TextFilter(Hierarchy) instead.

Creates a new TextFilter instance for the given dimension

Parameters:
dimension - the dimension to create the filter for

TextFilter

public TextFilter(Hierarchy hierarchy)
Creates a new TextFilter instance for the given hierarchy

Parameters:
hierarchy - the hierarchy to create the filter for

TextFilter

public TextFilter(Dimension dimension,
                  TextFilterSetting setting)
Deprecated. use TextFilter(Hierarchy, TextFilterSetting) instead.

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

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

TextFilter

public TextFilter(Hierarchy hierarchy,
                  TextFilterSetting setting)
Creates a new TextFilter 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 TextFilter 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

getSettings

public final TextFilterSetting 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

getType

public 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

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