Class EvalRootStateNode
java.lang.Object
com.espertech.esper.common.internal.epl.pattern.core.EvalStateNode
com.espertech.esper.common.internal.epl.pattern.core.EvalRootStateNode
- All Implemented Interfaces:
EvalRootMatchRemover
,EvalRootState
,Evaluator
,StopCallback
This class is always the root node in the evaluation state tree representing any activated event expression.
It hold the handle to a further state node with subnodes making up a whole evaluation state tree.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final EvalRootNode
protected EvalNode
protected EvalStateNode
Fields inherited from interface com.espertech.esper.common.internal.epl.pattern.core.EvalRootState
EMPTY_ARRAY
-
Constructor Summary
ConstructorDescriptionEvalRootStateNode
(EvalRootNode rootNode, EvalNode rootSingleChildNode) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
accept
(EvalStateNodeVisitor visitor) Accept a visitor.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.Returns the factory node for the state node.boolean
boolean
boolean
boolean
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
setCallback
(PatternMatchCallback callback) Hands the callback to use to indicate matching events.final void
start
(MatchedEventMap beginState) Starts the event expression or an instance of it.void
startRecoverable
(boolean startRecoverable, MatchedEventMap beginState) final void
stop()
Stops the underlying resources.final String
toString()
Methods inherited from class com.espertech.esper.common.internal.epl.pattern.core.EvalStateNode
getParentEvaluator, setParentEvaluator, transfer
-
Field Details
-
rootNode
-
rootSingleChildNode
-
topStateNode
-
-
Constructor Details
-
EvalRootStateNode
Constructor.- Parameters:
rootNode
- root noderootSingleChildNode
- is the root nodes single child node
-
-
Method Details
-
getFactoryNode
Description copied from class:EvalStateNode
Returns the factory node for the state node.- Specified by:
getFactoryNode
in classEvalStateNode
- Returns:
- factory node
-
setCallback
Hands the callback to use to indicate matching events.- Specified by:
setCallback
in interfaceEvalRootState
- Parameters:
callback
- is invoked when the event expressions turns true.
-
quit
public 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
-
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
-
stop
public final void stop()Description copied from interface:StopCallback
Stops the underlying resources.- Specified by:
stop
in interfaceStopCallback
-
startRecoverable
- Specified by:
startRecoverable
in interfaceEvalRootState
-
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
-
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 interfaceEvalRootState
- Specified by:
accept
in classEvalStateNode
- Parameters:
visitor
- on which the visit method is invoked by each node
-
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
-
toString
-
getTopStateNode
-
removeMatch
Description copied from class:EvalStateNode
Remove matches that overlap with the provided events.- Specified by:
removeMatch
in interfaceEvalRootMatchRemover
- Specified by:
removeMatch
in classEvalStateNode
- Parameters:
matchEvent
- set of events to check for
-