org.jcreme.filters
Class BaseReportFilter

java.lang.Object
  extended byorg.jcreme.filters.BaseReportFilter
All Implemented Interfaces:
java.lang.Cloneable, Filter, ReportFilter, java.io.Serializable
Direct Known Subclasses:
ANDFilter, ORFilter

public abstract class BaseReportFilter
extends java.lang.Object
implements ReportFilter, java.io.Serializable

The abstract base class for every ReportFilter. Implements handling of listeners and events.

Version:
$Revision: 1.2 $
Author:
$Author: dbregeon $
See Also:
Serialized Form

Field Summary
(package private) static long serialVersionUID
           
 
Constructor Summary
BaseReportFilter()
           
 
Method Summary
 void addFilterChangeListener(FilterChangeListener listener)
          This enables to add a listener for the changes of the filter.
protected  FilterChangeEvent buildEvent(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Builds a new FilterChangeEvent from the passed in parameters.
 java.lang.Object clone()
          This method clones this filter adds its listeners to its clone.
protected  boolean filtersAreEqual(Filter[] a, Filter[] b)
          Convenience method that tests whether two arrays of filters are equal.
protected  boolean filtersAreEqual(Filter a, Filter b)
          Convenience method that tests whether two filters are equal.
protected  void fireFilterChangeEvent(FilterChangeEvent evt)
          Fires the passed in FilterChangeEvent if there was an actual modification from oldValue to newValue.
 void removeFilterChangeListener(FilterChangeListener listener)
          This enables to remove a listener for the changes of the filter.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jcreme.filters.Filter
accept
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

BaseReportFilter

public BaseReportFilter()
Method Detail

addFilterChangeListener

public void addFilterChangeListener(FilterChangeListener listener)
This enables to add a listener for the changes of the filter.

Specified by:
addFilterChangeListener in interface ReportFilter
Parameters:
listener - the object that will react to the modifications.

fireFilterChangeEvent

protected void fireFilterChangeEvent(FilterChangeEvent evt)
Fires the passed in FilterChangeEvent if there was an actual modification from oldValue to newValue.

Parameters:
evt - The FilterChangeEvent to be fired.

buildEvent

protected FilterChangeEvent buildEvent(java.lang.String propertyName,
                                       java.lang.Object oldValue,
                                       java.lang.Object newValue)
Builds a new FilterChangeEvent from the passed in parameters.

Parameters:
propertyName - The property that has changed.
oldValue - The previous value associated to the given property.
newValue - The new value associated to the given property.
Returns:
The built FilterChangeEvent.

removeFilterChangeListener

public void removeFilterChangeListener(FilterChangeListener listener)
This enables to remove a listener for the changes of the filter.

Specified by:
removeFilterChangeListener in interface ReportFilter
Parameters:
listener - the listener to remove.

clone

public java.lang.Object clone()
This method clones this filter adds its listeners to its clone.

Specified by:
clone in interface Filter
Returns:
the cloned BaseReportFilter.

filtersAreEqual

protected boolean filtersAreEqual(Filter a,
                                  Filter b)
Convenience method that tests whether two filters are equal.

Parameters:
a - The first filter.
b - The second filter.
Returns:
True if the filters are equal, false otherwise.

filtersAreEqual

protected boolean filtersAreEqual(Filter[] a,
                                  Filter[] b)
Convenience method that tests whether two arrays of filters are equal.

Parameters:
a - The first array of filters.
b - The second array of filters.
Returns:
True if corresponding filters of both arrays are all equal to each other, false otherwise.


Copyright 2006 null. All Rights Reserved.