org.palo.api.subsets.filter
Class AliasFilter

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

public class AliasFilter
extends java.lang.Object
implements EffectiveFilter

AliasFilter

An alias filter belongs to the category of affective filters. The influenced filters are namely the TextFilter and SortingFilter. When used the alias Attribute is used to filter subset elements.

Version:
$Id: AliasFilter.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
AliasFilter(Dimension dimension)
          Deprecated. use AliasFilter(Hierarchy) instead.
AliasFilter(Dimension dimension, AliasFilterSetting setting)
          Deprecated. use AliasFilter(Hierarchy, AliasFilterSetting) instead.
AliasFilter(Hierarchy hierarchy)
          Creates a new AliasFilter instance for the given hierarchy
AliasFilter(Hierarchy hierarchy, AliasFilterSetting setting)
          Creates a new AliasFilter 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!
 AliasFilter copy()
          Creates a deep copy of this subset filter
 void filter(java.util.List<ElementNode> elements)
           
 java.lang.String getAlias(Element element)
          Returns the alias name to use for the given Element
 Dimension getDimension()
           
 int[] getEffectiveFilter()
          Returns the filter types which are affected by this filter.
 Hierarchy getHierarchy()
          Convenient method to access the subset hierarchy.
 AliasFilterSetting 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

AliasFilter

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

Creates a new AliasFilter instance for the given dimension

Parameters:
dimension - the dimension to create the filter for

AliasFilter

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

Parameters:
hierarchy - the hierarchy to create the filter for

AliasFilter

public AliasFilter(Dimension dimension,
                   AliasFilterSetting setting)
Deprecated. use AliasFilter(Hierarchy, AliasFilterSetting) instead.

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

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

AliasFilter

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

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

getAlias

public final java.lang.String getAlias(Element element)
Returns the alias name to use for the given Element

Parameters:
element - the Element to get the alias for
Returns:
the alias of the given element or its name if no alias was defined

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 AliasFilterSetting getSettings()
Description copied from interface: SubsetFilter
Returns the internal settings of this filter.

Specified by:
getSettings in interface SubsetFilter
Returns:

filter

public void filter(java.util.List<ElementNode> elements)

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