Class AbstractFilter
java.lang.Object
nl.tudelft.simulation.language.filters.AbstractFilter
- All Implemented Interfaces:
Serializable
,FilterInterface
- Direct Known Subclasses:
CompositeFilter
,MaxPointFilter
,ModulusFilter
,ZeroFilter
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.
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Author:
- Niels Lang , Peter Jacobs
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
a filter defines whether to accept a value in a chart.and
(FilterInterface filter) adds filter to this filter and returns the composed filter.protected abstract boolean
filters the entry.abstract String
returns a string representation of the criterion.boolean
is the filter inverted?or
(FilterInterface filter) creates a new composite filter which is one or two.void
setInverted
(boolean inverted) inverts the filter.toString()
-
Field Details
-
inverted
protected boolean invertedis this filter inverted.
-
-
Constructor Details
-
AbstractFilter
public AbstractFilter()constructs a new AbstractFilter.
-
-
Method Details
-
isInverted
public boolean isInverted()is the filter inverted?- Specified by:
isInverted
in interfaceFilterInterface
- Returns:
- whether the filter is inverted.
-
setInverted
public void setInverted(boolean inverted) inverts the filter.- Specified by:
setInverted
in interfaceFilterInterface
- Parameters:
inverted
- boolean; whether to invert the filter
-
accept
a filter defines whether to accept a value in a chart.- Specified by:
accept
in interfaceFilterInterface
- Parameters:
entry
- Object; the entry to filter- Returns:
- whether to accept this entry
-
filter
filters the entry. This method should be implemented by every filter based on its semantic meaning.- Parameters:
entry
- Object; the entry to filter.- Returns:
- whether to accept the value.
-
getCriterion
returns a string representation of the criterion.- Specified by:
getCriterion
in interfaceFilterInterface
- Returns:
- the string representing the criterion
-
and
adds filter to this filter and returns the composed filter.- Specified by:
and
in interfaceFilterInterface
- Parameters:
filter
- FilterInterface; the filter to add- Returns:
- the composed filter
-
or
creates a new composite filter which is one or two.- Specified by:
or
in interfaceFilterInterface
- Parameters:
filter
- FilterInterface; the filter to add- Returns:
- the composed filter
-
toString
-