nl.tudelft.simulation.language.filters
Class AbstractFilter

java.lang.Object
  extended by nl.tudelft.simulation.language.filters.AbstractFilter
All Implemented Interfaces:
Serializable, Filterinterface
Direct Known Subclasses:
CompositeFilter, MaxPointFilter, ModulusFilter, ZeroFilter

public abstract class AbstractFilter
extends Object
implements Filterinterface

The abstract filter forms the abstract class for all filters. The filter method should be implemented by all subclasses. This filter method should have the same semantics as the accept(inverted=false) method.

(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
protected  boolean inverted
          is this filter inverted
 
Constructor Summary
AbstractFilter()
          constructs a new AbstractFilter
 
Method Summary
 boolean accept(Object entry)
          a filter defines whether to accept a value in a chart
 Filterinterface and(Filterinterface filter)
          adds filter to this filter and returns the composed filter
protected abstract  boolean filter(Object entry)
          filters the entry.
abstract  String getCriterium()
          returns the filter criterium
 boolean isInverted()
          is the filter inverted?
 Filterinterface or(Filterinterface filter)
          creates a new composite filter which is one or two
 void setInverted(boolean inverted)
          inverts the filter
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inverted

protected boolean inverted
is this filter inverted

Constructor Detail

AbstractFilter

public AbstractFilter()
constructs a new AbstractFilter

Method Detail

isInverted

public boolean isInverted()
Description copied from interface: Filterinterface
is the filter inverted?

Specified by:
isInverted in interface Filterinterface
Returns:
whether the filter is inverted.
See Also:
Filterinterface.isInverted()

setInverted

public void setInverted(boolean inverted)
Description copied from interface: Filterinterface
inverts the filter

Specified by:
setInverted in interface Filterinterface
Parameters:
inverted - whether to invert the filter
See Also:
#setInverted(boolean)

accept

public boolean accept(Object entry)
Description copied from interface: Filterinterface
a filter defines whether to accept a value in a chart

Specified by:
accept in interface Filterinterface
Parameters:
entry - the entry to filter
Returns:
whether to accept this entry
See Also:
Filterinterface.accept(java.lang.Object)

filter

protected abstract boolean filter(Object entry)
filters the entry. This method should be implemented by every filter based on its semantic meaning.

Parameters:
entry - the entry to filter.
Returns:
whether to accept the value.

getCriterium

public abstract String getCriterium()
returns the filter criterium

Specified by:
getCriterium in interface Filterinterface
Returns:
the criterium

and

public Filterinterface and(Filterinterface filter)
adds filter to this filter and returns the composed filter

Specified by:
and in interface Filterinterface
Parameters:
filter - the filter to add
Returns:
the composed filter

or

public Filterinterface or(Filterinterface filter)
creates a new composite filter which is one or two

Specified by:
or in interface Filterinterface
Parameters:
filter - the filter to add
Returns:
the composed filter

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


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