com.sciapp.filter
Class OrTableFilter

java.lang.Object
  extended by com.sciapp.filter.TableFilter
      extended by com.sciapp.filter.OrTableFilter

public class OrTableFilter
extends TableFilter

A TableFilter that implements the logical OR operator on individual TableFilters.


Field Summary
protected  TableFilter[] tableFilters
          The array of TableFilters on which the OR operator should be applied.
 
Fields inherited from class com.sciapp.filter.TableFilter
ALL_COLUMNS, column, filter
 
Constructor Summary
OrTableFilter(TableFilter[] tableFilters)
          Constructs an OrTableFilter with an array of TableFilters.
OrTableFilter(TableFilter filter1, TableFilter filter2)
          Constructs an OrTableFilter with two TableFilters.
 
Method Summary
 boolean filter(ListTableModel model, Object row)
          The OR operation.
 TableFilter[] getTableFilters()
          Returns the array of the supplied TableFilters that are ORed.
 void setColumn(int column)
          Sets the column to filter.
 
Methods inherited from class com.sciapp.filter.TableFilter
getColumn, getFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableFilters

protected TableFilter[] tableFilters
The array of TableFilters on which the OR operator should be applied.

Constructor Detail

OrTableFilter

public OrTableFilter(TableFilter[] tableFilters)
Constructs an OrTableFilter with an array of TableFilters.


OrTableFilter

public OrTableFilter(TableFilter filter1,
                     TableFilter filter2)
Constructs an OrTableFilter with two TableFilters.

Method Detail

filter

public boolean filter(ListTableModel model,
                      Object row)
The OR operation. The TableFilters specified in the constructor are applied to the given row and the OR operation is applied to their results.

Overrides:
filter in class TableFilter
Parameters:
model - the ListTableModel that holds a reference to the tabular row data
row - the row of the table to filter, represented as an object
Returns:
true if the OR succeeds, false otherwise.

getTableFilters

public TableFilter[] getTableFilters()
Returns the array of the supplied TableFilters that are ORed.

Returns:
an array of TableFilters

setColumn

public void setColumn(int column)
Sets the column to filter. ALL_COLUMNS indicates that all columns should be filtered.

Overrides:
setColumn in class TableFilter
Parameters:
column - the column of the table to filter