nl.tudelft.simulation.language.filters
Class CompositeFilter

java.lang.Object
  extended by nl.tudelft.simulation.language.filters.AbstractFilter
      extended by nl.tudelft.simulation.language.filters.CompositeFilter
All Implemented Interfaces:
Serializable, Filterinterface

public class CompositeFilter
extends AbstractFilter

The composite filter combines two filters.

(c) copyright 2002-2005 Delft University of Technology , the Netherlands.

See for project information www.simulation.tudelft.nl/language
License of use: Lesser General Public License (LGPL) , no warranty

Since:
1.2
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:25:54 $
Author:
Niels Lang Peter Jacobs
See Also:
Serialized Form

Field Summary
static short AND
          the AND operator
static short OR
          the OR operator
 
Fields inherited from class nl.tudelft.simulation.language.filters.AbstractFilter
inverted
 
Constructor Summary
CompositeFilter(Filterinterface filter1, Filterinterface filter2, short operator)
          constructs a new CompositeFilter
 
Method Summary
protected  boolean filter(Object entry)
          filters the entry.
 String getCriterium()
          returns the filter criterium
protected  String operatorToString()
          Converts the operator of this filter into a human readable string.
 
Methods inherited from class nl.tudelft.simulation.language.filters.AbstractFilter
accept, and, isInverted, or, setInverted, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AND

public static final short AND
the AND operator

See Also:
Constant Field Values

OR

public static final short OR
the OR operator

See Also:
Constant Field Values
Constructor Detail

CompositeFilter

public CompositeFilter(Filterinterface filter1,
                       Filterinterface filter2,
                       short operator)
constructs a new CompositeFilter

Parameters:
filter1 - the first filter
filter2 - the second filter
operator - the operator (AND or OR)
Method Detail

filter

protected boolean filter(Object entry)
Description copied from class: AbstractFilter
filters the entry. This method should be implemented by every filter based on its semantic meaning.

Specified by:
filter in class AbstractFilter
Parameters:
entry - the entry to filter.
Returns:
whether to accept the value.
See Also:
AbstractFilter.filter(java.lang.Object)

operatorToString

protected String operatorToString()
Converts the operator of this filter into a human readable string.

Returns:
the operator in human readable string

getCriterium

public String getCriterium()
Description copied from class: AbstractFilter
returns the filter criterium

Specified by:
getCriterium in interface Filterinterface
Specified by:
getCriterium in class AbstractFilter
Returns:
the criterium
See Also:
AbstractFilter.getCriterium()


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.