Class EvalAndStateNode
java.lang.Object
com.espertech.esper.common.internal.epl.pattern.core.EvalStateNode
com.espertech.esper.common.internal.epl.pattern.and.EvalAndStateNode
- All Implemented Interfaces:
Evaluator
This class represents the state of an "and" operator in the evaluation state tree.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final EvalStateNode[]
protected final EvalAndNode
protected Object[]
-
Constructor Summary
ConstructorDescriptionEvalAndStateNode
(Evaluator parentNode, EvalAndNode evalAndNode) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
accept
(EvalStateNodeVisitor visitor) Accept a visitor.static void
addMatchEvent
(Object[] eventsPerChild, int indexFrom, MatchedEventMap matchEvent) final void
evaluateFalse
(EvalStateNode fromNode, boolean restartable) Indicate a change in truth value to false.final void
evaluateTrue
(MatchedEventMap matchEvent, EvalStateNode fromNode, boolean isQuitted, EventBean optionalTriggeringEvent) Indicate a change in truth value to true.static List<MatchedEventMap>
generateMatchEvents
(MatchedEventMap matchEvent, Object[] eventsPerChild, int indexFrom) Generate a list of matching event combinations constisting of the events per child that are passed in.protected static void
generateMatchEvents
(ArrayList<List<MatchedEventMap>> eventList, int index, List<MatchedEventMap> result, MatchedEventMap matchEvent) For each combination of MatchedEventMap instance in all collections, add an entry to the list.Returns the factory node for the state node.boolean
boolean
boolean
boolean
final void
quit()
Stops the event expression or an instance of it.void
removeMatch
(Set<EventBean> matchEvent) Remove matches that overlap with the provided events.final void
start
(MatchedEventMap beginState) Starts the event expression or an instance of it.final String
toString()
Methods inherited from class com.espertech.esper.common.internal.epl.pattern.core.EvalStateNode
getParentEvaluator, setParentEvaluator, transfer
-
Field Details
-
evalAndNode
-
activeChildNodes
-
eventsPerChild
-
-
Constructor Details
-
EvalAndStateNode
Constructor.- Parameters:
parentNode
- is the parent evaluator to call to indicate truth valueevalAndNode
- is the factory node associated to the state
-
-
Method Details
-
removeMatch
Description copied from class:EvalStateNode
Remove matches that overlap with the provided events.- Specified by:
removeMatch
in classEvalStateNode
- Parameters:
matchEvent
- set of events to check for
-
getFactoryNode
Description copied from class:EvalStateNode
Returns the factory node for the state node.- Specified by:
getFactoryNode
in classEvalStateNode
- Returns:
- factory node
-
start
Description copied from class:EvalStateNode
Starts the event expression or an instance of it. Child classes are expected to initialize and start any event listeners or schedule any time-based callbacks as needed.- Specified by:
start
in classEvalStateNode
- Parameters:
beginState
- begin state
-
isFilterStateNode
public boolean isFilterStateNode()- Specified by:
isFilterStateNode
in classEvalStateNode
-
isNotOperator
public boolean isNotOperator()- Specified by:
isNotOperator
in classEvalStateNode
-
isFilterChildNonQuitting
public boolean isFilterChildNonQuitting()- Specified by:
isFilterChildNonQuitting
in interfaceEvaluator
-
isObserverStateNodeNonRestarting
public boolean isObserverStateNodeNonRestarting()- Specified by:
isObserverStateNodeNonRestarting
in classEvalStateNode
-
evaluateTrue
public final void evaluateTrue(MatchedEventMap matchEvent, EvalStateNode fromNode, boolean isQuitted, EventBean optionalTriggeringEvent) Description copied from interface:Evaluator
Indicate a change in truth value to true.- Specified by:
evaluateTrue
in interfaceEvaluator
- Parameters:
matchEvent
- is the container for events that caused the change in truth valuefromNode
- is the node that indicates the changeisQuitted
- is an indication of whether the node continues listenening or stops listeningoptionalTriggeringEvent
- in case the truth value changed to true in direct response to an event arriving, provides that event
-
evaluateFalse
Description copied from interface:Evaluator
Indicate a change in truth value to false.- Specified by:
evaluateFalse
in interfaceEvaluator
- Parameters:
fromNode
- is the node that indicates the changerestartable
- whether the evaluator can be restarted
-
generateMatchEvents
public static List<MatchedEventMap> generateMatchEvents(MatchedEventMap matchEvent, Object[] eventsPerChild, int indexFrom) Generate a list of matching event combinations constisting of the events per child that are passed in.- Parameters:
matchEvent
- can be populated with prior events that must be passed oneventsPerChild
- is the list of events for each child node to the "And" node.indexFrom
- from-index- Returns:
- list of events populated with all possible combinations
-
generateMatchEvents
protected static void generateMatchEvents(ArrayList<List<MatchedEventMap>> eventList, int index, List<MatchedEventMap> result, MatchedEventMap matchEvent) For each combination of MatchedEventMap instance in all collections, add an entry to the list. Recursive method.- Parameters:
eventList
- is an array of lists containing MatchedEventMap instances to combineindex
- is the current index into the arrayresult
- is the resulting list of MatchedEventMapmatchEvent
- is the start MatchedEventMap to generate from
-
quit
public final void quit()Description copied from class:EvalStateNode
Stops the event expression or an instance of it. Child classes are expected to free resources and stop any event listeners or remove any time-based callbacks.- Specified by:
quit
in classEvalStateNode
-
accept
Description copied from class:EvalStateNode
Accept a visitor. Child classes are expected to invoke the visit method on the visitor instance passed in.- Specified by:
accept
in classEvalStateNode
- Parameters:
visitor
- on which the visit method is invoked by each node
-
toString
-
addMatchEvent
public static void addMatchEvent(Object[] eventsPerChild, int indexFrom, MatchedEventMap matchEvent)
-