public abstract class SimpleCondition<T> extends IterativeCondition<T> implements FilterFunction<T>
NFA
.
Contrary to the IterativeCondition
, conditions that extend this class do not have access to the
previously accepted elements in the pattern. Conditions that extend this class are simple filter(...)
functions that decide based on the properties of the element at hand.
IterativeCondition.Context<T>
Constructor and Description |
---|
SimpleCondition() |
Modifier and Type | Method and Description |
---|---|
boolean |
filter(T value,
IterativeCondition.Context<T> ctx)
The filter function that evaluates the predicate.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
filter
public boolean filter(T value, IterativeCondition.Context<T> ctx) throws Exception
IterativeCondition
IMPORTANT: The system assumes that the function does not modify the elements on which the predicate is applied. Violating this assumption can lead to incorrect results.
filter
in class IterativeCondition<T>
value
- The value to be tested.ctx
- The IterativeCondition.Context
used for the evaluation of the function and provides access to
the already accepted events in the pattern (see IterativeCondition.Context.getEventsForPattern(String)
).true
for values that should be retained, false
for values to be filtered out.Exception
- This method may throw exceptions. Throwing an exception will cause the operation
to fail and may trigger recovery.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.