com.espertech.esper.pattern
Class EvalNode

java.lang.Object
  extended by com.espertech.esper.pattern.EvalNode
All Implemented Interfaces:
MetaDefItem, Serializable
Direct Known Subclasses:
EvalAndNode, EvalEveryNode, EvalFilterNode, EvalFollowedByNode, EvalGuardNode, EvalNotNode, EvalObserverNode, EvalOrNode, EvalRootNode

public abstract class EvalNode
extends Object
implements MetaDefItem

Superclass of all nodes in an evaluation tree representing an event pattern expression. Follows the Composite pattern. Child nodes do not carry references to parent nodes, the tree is unidirectional.

See Also:
Serialized Form

Method Summary
 void addChildNode(EvalNode childNode)
          Adds a child node.
 void dumpDebug(String prefix)
          Recursively print out all nodes.
 List<EvalNode> getChildNodes()
          Returns list of child nodes.
 EvalNodeNumber getNodeNumber()
          Returns the evaluation node's relative node number in the evaluation node tree.
abstract  EvalStateNode newState(Evaluator parentNode, MatchedEventMap beginState, PatternContext context, Object stateNodeId)
          Create the evaluation state node containing the truth value state for each operator in an event expression.
static EvalNodeAnalysisResult recursiveAnalyzeChildNodes(EvalNode currentNode)
          Searched recursivly for pattern evaluation filter nodes.
 void setNodeNumber(EvalNodeNumber nodeNumber)
          Sets the evaluation node's relative node number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newState

public abstract EvalStateNode newState(Evaluator parentNode,
                                       MatchedEventMap beginState,
                                       PatternContext context,
                                       Object stateNodeId)
Create the evaluation state node containing the truth value state for each operator in an event expression.

Parameters:
parentNode - is the parent evaluator node that this node indicates a change in truth value to
beginState - is the container for events that makes up the start state
context - is the handle to services required for evaluation
stateNodeId - is the new state object's identifier
Returns:
state node containing the truth value state for the operator

getNodeNumber

public EvalNodeNumber getNodeNumber()
Returns the evaluation node's relative node number in the evaluation node tree.

Returns:
node number

setNodeNumber

public void setNodeNumber(EvalNodeNumber nodeNumber)
Sets the evaluation node's relative node number.

Parameters:
nodeNumber - is the node number to set

addChildNode

public final void addChildNode(EvalNode childNode)
Adds a child node.

Parameters:
childNode - is the child evaluation tree node to add

getChildNodes

public final List<EvalNode> getChildNodes()
Returns list of child nodes.

Returns:
list of child nodes

dumpDebug

public final void dumpDebug(String prefix)
Recursively print out all nodes.

Parameters:
prefix - is printed out for naming the printed info

recursiveAnalyzeChildNodes

public static EvalNodeAnalysisResult recursiveAnalyzeChildNodes(EvalNode currentNode)
Searched recursivly for pattern evaluation filter nodes.

Parameters:
currentNode - is the root node
Returns:
list of filter nodes

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com