Class CompositeFilter
java.lang.Object
nl.tudelft.simulation.language.filters.AbstractFilter
nl.tudelft.simulation.language.filters.CompositeFilter
- All Implemented Interfaces:
Serializable
,FilterInterface
The composite filter combines two filters.
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The enum for the logical operator in composite filters. -
Field Summary
Fields inherited from class nl.tudelft.simulation.language.filters.AbstractFilter
inverted
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeFilter
(FilterInterface filter1, FilterInterface filter2, CompositeFilter.Operator operator) constructs a new CompositeFilter. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
filters the entry.returns a string representation of the criterion.protected String
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
-
Constructor Details
-
CompositeFilter
public CompositeFilter(FilterInterface filter1, FilterInterface filter2, CompositeFilter.Operator operator) constructs a new CompositeFilter.- Parameters:
filter1
- FilterInterface; the first filterfilter2
- FilterInterface; the second filteroperator
- Operator; the operator (AND or OR)
-
-
Method Details
-
filter
filters the entry. This method should be implemented by every filter based on its semantic meaning.- Specified by:
filter
in classAbstractFilter
- Parameters:
entry
- Object; the entry to filter.- Returns:
- whether to accept the value.
-
operatorToString
Converts the operator of this filter into a human readable string.- Returns:
- the operator in human readable string
-
getCriterion
returns a string representation of the criterion.- Specified by:
getCriterion
in interfaceFilterInterface
- Specified by:
getCriterion
in classAbstractFilter
- Returns:
- the string representing the criterion
-