net.coderazzi.filters
Class ComposedFilter

java.lang.Object
  extended by net.coderazzi.filters.artifacts.RowFilter
      extended by net.coderazzi.filters.Filter
          extended by net.coderazzi.filters.ComposedFilter
All Implemented Interfaces:
IFilter, IFilterObserver
Direct Known Subclasses:
AndFilter, OrFilter

public abstract class ComposedFilter
extends Filter
implements IFilterObserver

Abstract parent class to support the composition of multiple filters.

The exact composition semantics (and / or / not) are not defined.

Author:
Luis M Pena - lu@coderazzi.net

Nested Class Summary
 
Nested classes/interfaces inherited from class net.coderazzi.filters.artifacts.RowFilter
RowFilter.Entry
 
Field Summary
protected  Set<IFilter> filters
          Set of associated IFilters.
 
Constructor Summary
protected ComposedFilter()
          Default constructor.
protected ComposedFilter(IFilter... observables)
          Constructor built up out of one or more IFilter instances.
 
Method Summary
 void addFilter(IFilter... filtersToAdd)
          Subscribes one or more IFilter instances to receive filter events from this composition filter.
 void filterUpdated(IFilter filter)
          Notification made by the observer when the associated IFilter instance updates the held filter.
 Set<IFilter> getFilters()
          Returns all IFilter instances previously added.
protected  boolean isDisabled(IFilter filter)
          Returns true if there is information of this filter as disabled.
 void removeFilter(IFilter... filtersToRemove)
          Unsubscribes one or more IFilters that were previously subscribed to receive filter events.
 void setEnabled(boolean enable)
          Enables/Disables the filter.
 
Methods inherited from class net.coderazzi.filters.Filter
addFilterObserver, getFilterObservers, isEnabled, removeFilterObserver, reportFilterUpdatedToObservers
 
Methods inherited from class net.coderazzi.filters.artifacts.RowFilter
include
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.coderazzi.filters.IFilter
include
 

Field Detail

filters

protected Set<IFilter> filters
Set of associated IFilters.

Constructor Detail

ComposedFilter

protected ComposedFilter()
Default constructor.


ComposedFilter

protected ComposedFilter(IFilter... observables)
Constructor built up out of one or more IFilter instances.

Method Detail

addFilter

public void addFilter(IFilter... filtersToAdd)
Subscribes one or more IFilter instances to receive filter events from this composition filter.


removeFilter

public void removeFilter(IFilter... filtersToRemove)
Unsubscribes one or more IFilters that were previously subscribed to receive filter events.


getFilters

public Set<IFilter> getFilters()
Returns all IFilter instances previously added.


filterUpdated

public void filterUpdated(IFilter filter)
Description copied from interface: IFilterObserver

Notification made by the observer when the associated IFilter instance updates the held filter.

Specified by:
filterUpdated in interface IFilterObserver
See Also:
IFilterObserver.filterUpdated(IFilter)

setEnabled

public void setEnabled(boolean enable)
Description copied from interface: IFilter
Enables/Disables the filter.

Specified by:
setEnabled in interface IFilter
Overrides:
setEnabled in class Filter
See Also:
IFilter.setEnabled(boolean)

isDisabled

protected boolean isDisabled(IFilter filter)
Returns true if there is information of this filter as disabled.