public class EvalRootStateNode extends EvalStateNode implements Evaluator, PatternStopCallback, EvalRootState
Modifier and Type | Field and Description |
---|---|
protected EvalNode |
rootSingleChildNode |
protected EvalStateNode |
topStateNode |
Constructor and Description |
---|
EvalRootStateNode(EvalNode rootSingleChildNode)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(EvalStateNodeVisitor visitor)
Accept a visitor.
|
void |
evaluateFalse(EvalStateNode fromNode,
boolean restartable)
Indicate a change in truth value to false.
|
void |
evaluateTrue(MatchedEventMap matchEvent,
EvalStateNode fromNode,
boolean isQuitted)
Indicate a change in truth value to true.
|
EvalNode |
getFactoryNode()
Returns the factory node for the state node.
|
EvalStateNode |
getTopStateNode() |
void |
handleChildQuitEvent() |
void |
handleEvaluateFalseEvent() |
void |
handleQuitEvent() |
boolean |
isFilterChildNonQuitting() |
boolean |
isFilterStateNode() |
boolean |
isNotOperator() |
boolean |
isObserverStateNodeNonRestarting() |
void |
quit()
Stops the event expression or an instance of it.
|
void |
removeMatch(Set<EventBean> matchEvent)
Remove matches that overlap with the provided events.
|
void |
setCallback(PatternMatchCallback callback)
Hands the callback to use to indicate matching events.
|
void |
start(MatchedEventMap beginState)
Starts the event expression or an instance of it.
|
void |
startRecoverable(boolean startRecoverable,
MatchedEventMap beginState) |
void |
stop()
Stops the underlying resources.
|
String |
toString() |
getParentEvaluator, setParentEvaluator
protected EvalNode rootSingleChildNode
protected EvalStateNode topStateNode
public EvalRootStateNode(EvalNode rootSingleChildNode)
rootSingleChildNode
- is the root nodes single child nodepublic EvalNode getFactoryNode()
EvalStateNode
getFactoryNode
in class EvalStateNode
public final void setCallback(PatternMatchCallback callback)
setCallback
in interface EvalRootState
callback
- is invoked when the event expressions turns true.public void startRecoverable(boolean startRecoverable, MatchedEventMap beginState)
startRecoverable
in interface EvalRootState
public final void start(MatchedEventMap beginState)
EvalStateNode
start
in class EvalStateNode
beginState
- begin statepublic final void stop()
StopCallback
stop
in interface StopCallback
public void quit()
EvalStateNode
quit
in class EvalStateNode
public void handleQuitEvent()
public void handleChildQuitEvent()
public void handleEvaluateFalseEvent()
public final void evaluateTrue(MatchedEventMap matchEvent, EvalStateNode fromNode, boolean isQuitted)
Evaluator
evaluateTrue
in interface Evaluator
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 listeningpublic final void evaluateFalse(EvalStateNode fromNode, boolean restartable)
Evaluator
evaluateFalse
in interface Evaluator
fromNode
- is the node that indicates the changerestartable
- whether the evaluator can be restartedpublic final void accept(EvalStateNodeVisitor visitor)
EvalStateNode
accept
in interface EvalRootState
accept
in class EvalStateNode
visitor
- on which the visit method is invoked by each nodepublic boolean isFilterStateNode()
isFilterStateNode
in class EvalStateNode
public boolean isNotOperator()
isNotOperator
in class EvalStateNode
public boolean isFilterChildNonQuitting()
isFilterChildNonQuitting
in interface Evaluator
public boolean isObserverStateNodeNonRestarting()
isObserverStateNodeNonRestarting
in class EvalStateNode
public EvalStateNode getTopStateNode()
public void removeMatch(Set<EventBean> matchEvent)
EvalStateNode
removeMatch
in interface EvalRootMatchRemover
removeMatch
in class EvalStateNode
matchEvent
- set of events to check for