com.townleyenterprises.filter
Class LogicalFilter

java.lang.Object
  extended bycom.townleyenterprises.filter.LogicalFilter
All Implemented Interfaces:
Filter
Direct Known Subclasses:
LogicalAndFilter, LogicalOrFilter

public abstract class LogicalFilter
extends java.lang.Object
implements Filter

This package class provides the base operation common to all logical comparison filters within the system.

Version:
$Id: LogicalFilter.java,v 1.4 2004/07/28 10:33:58 atownley Exp $
Author:
Andrew S. Townley

Field Summary
protected  java.util.ArrayList _filters
          the list of filters to be executed over the object
 
Constructor Summary
protected LogicalFilter(java.lang.String op)
          The constructor is used simply to provide an operator string description which is used in the toString() method.
 
Method Summary
 void addFilter(Filter f)
          Adds a new filter to this compound filter.
 void clear()
          This method is used to clear all of the filters in this instance.
abstract  boolean doFilter(java.lang.Object o)
          This method actually performs the operation that will determine if the parameter object should be included in the "result" or not.
 int getFilterCount()
          This method returns the number of filters in the compound filter.
 java.util.Iterator iterator()
          Returns an iterator over the filters in this filter.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_filters

protected final java.util.ArrayList _filters
the list of filters to be executed over the object

Constructor Detail

LogicalFilter

protected LogicalFilter(java.lang.String op)
The constructor is used simply to provide an operator string description which is used in the toString() method.

Parameters:
op - the operator string which should be displayed
Method Detail

addFilter

public void addFilter(Filter f)
Adds a new filter to this compound filter.

Parameters:
f - the new filter

doFilter

public abstract boolean doFilter(java.lang.Object o)
This method actually performs the operation that will determine if the parameter object should be included in the "result" or not.

Specified by:
doFilter in interface Filter
Parameters:
o - the object to be tested
Returns:
true if the object should be included in the result; false if the object should not

getFilterCount

public int getFilterCount()
This method returns the number of filters in the compound filter.

Returns:
the filter count

clear

public void clear()
This method is used to clear all of the filters in this instance.


iterator

public java.util.Iterator iterator()
Returns an iterator over the filters in this filter.

Returns:
an Iterator

toString

public java.lang.String toString()


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.