com.espertech.esper.pattern
Class EvalRootStateNode

java.lang.Object
  extended by com.espertech.esper.pattern.EvalStateNode
      extended by com.espertech.esper.pattern.EvalRootStateNode
All Implemented Interfaces:
EvalRootState, Evaluator, PatternStopCallback, StopCallback

public class EvalRootStateNode
extends EvalStateNode
implements Evaluator, PatternStopCallback, EvalRootState

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
protected  EvalNode rootSingleChildNode
           
protected  EvalStateNode topStateNode
           
 
Constructor Summary
EvalRootStateNode(EvalNode rootSingleChildNode)
          Constructor.
 
Method Summary
 java.lang.Object accept(EvalStateNodeVisitor visitor, java.lang.Object data)
          Accept a visitor.
 java.lang.Object childrenAccept(EvalStateNodeVisitor visitor, java.lang.Object data)
          Pass the visitor to all child nodes.
 void evaluateFalse(EvalStateNode fromNode)
          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()
           
 void quit()
          Stops the event expression or an instance of it.
 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.
 java.lang.String toString()
           
 
Methods inherited from class com.espertech.esper.pattern.EvalStateNode
getParentEvaluator, setParentEvaluator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rootSingleChildNode

protected EvalNode rootSingleChildNode

topStateNode

protected EvalStateNode topStateNode
Constructor Detail

EvalRootStateNode

public EvalRootStateNode(EvalNode rootSingleChildNode)
Constructor.

Parameters:
rootSingleChildNode - is the root nodes single child node
Method Detail

getFactoryNode

public EvalNode getFactoryNode()
Description copied from class: EvalStateNode
Returns the factory node for the state node.

Specified by:
getFactoryNode in class EvalStateNode
Returns:
factory node

setCallback

public final void setCallback(PatternMatchCallback callback)
Hands the callback to use to indicate matching events.

Specified by:
setCallback in interface EvalRootState
Parameters:
callback - is invoked when the event expressions turns true.

startRecoverable

public void startRecoverable(boolean startRecoverable,
                             MatchedEventMap beginState)
Specified by:
startRecoverable in interface EvalRootState

start

public final void start(MatchedEventMap beginState)
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 class EvalStateNode

stop

public final void stop()
Description copied from interface: StopCallback
Stops the underlying resources.

Specified by:
stop in interface StopCallback

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 class EvalStateNode

handleQuitEvent

public void handleQuitEvent()

handleChildQuitEvent

public void handleChildQuitEvent()

handleEvaluateFalseEvent

public void handleEvaluateFalseEvent()

evaluateTrue

public final void evaluateTrue(MatchedEventMap matchEvent,
                               EvalStateNode fromNode,
                               boolean isQuitted)
Description copied from interface: Evaluator
Indicate a change in truth value to true.

Specified by:
evaluateTrue in interface Evaluator
Parameters:
matchEvent - is the container for events that caused the change in truth value
fromNode - is the node that indicates the change
isQuitted - is an indication of whether the node continues listenening or stops listening

evaluateFalse

public final void evaluateFalse(EvalStateNode fromNode)
Description copied from interface: Evaluator
Indicate a change in truth value to false.

Specified by:
evaluateFalse in interface Evaluator
Parameters:
fromNode - is the node that indicates the change

accept

public final java.lang.Object accept(EvalStateNodeVisitor visitor,
                                     java.lang.Object data)
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 class EvalStateNode
Parameters:
visitor - on which the visit method is invoked by each node
data - any additional data the visitor may need is passed in this parameter
Returns:
any additional data the visitor may need or null

childrenAccept

public final java.lang.Object childrenAccept(EvalStateNodeVisitor visitor,
                                             java.lang.Object data)
Description copied from class: EvalStateNode
Pass the visitor to all child nodes.

Specified by:
childrenAccept in class EvalStateNode
Parameters:
visitor - is the instance to be passed to all child nodes
data - any additional data the visitor may need is passed in this parameter
Returns:
any additional data the visitor may need or null

isFilterStateNode

public boolean isFilterStateNode()
Specified by:
isFilterStateNode in class EvalStateNode

isNotOperator

public boolean isNotOperator()
Specified by:
isNotOperator in class EvalStateNode

isFilterChildNonQuitting

public boolean isFilterChildNonQuitting()
Specified by:
isFilterChildNonQuitting in interface Evaluator

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

getTopStateNode

public EvalStateNode getTopStateNode()

© 2006-2011 EsperTech Inc.
All rights reserved.
Visit us at espertech.com