com.espertech.esper.pattern
Class EvalObserverStateNode

java.lang.Object
  extended by com.espertech.esper.pattern.EvalStateNode
      extended by com.espertech.esper.pattern.EvalObserverStateNode
All Implemented Interfaces:
ObserverEventEvaluator

public class EvalObserverStateNode
extends EvalStateNode
implements ObserverEventEvaluator

This class represents the state of an eventObserver sub-expression in the evaluation state tree.


Field Summary
protected  EvalObserverNode evalObserverNode
           
protected  EventObserver eventObserver
           
 
Constructor Summary
EvalObserverStateNode(Evaluator parentNode, EvalObserverNode evalObserverNode)
          Constructor.
 
Method Summary
 void accept(EvalStateNodeVisitor visitor)
          Accept a visitor.
 PatternAgentInstanceContext getContext()
           
 EvalNode getFactoryNode()
          Returns the factory node for the state node.
 boolean isFilterStateNode()
           
 boolean isNotOperator()
           
 boolean isObserverStateNodeNonRestarting()
           
 void observerEvaluateFalse(boolean restartable)
          Indicate that the observer turned permanently false.
 void observerEvaluateTrue(MatchedEventMap matchEvent, boolean quitted)
          Indicate an event for evaluation (sub-expression the observer represents has turned true).
 void quit()
          Stops the event expression or an instance of it.
 void removeMatch(java.util.Set<EventBean> matchEvent)
          Remove matches that overlap with the provided events.
 void start(MatchedEventMap beginState)
          Starts the event expression or an instance of it.
 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

evalObserverNode

protected final EvalObserverNode evalObserverNode

eventObserver

protected EventObserver eventObserver
Constructor Detail

EvalObserverStateNode

public EvalObserverStateNode(Evaluator parentNode,
                             EvalObserverNode evalObserverNode)
Constructor.

Parameters:
parentNode - is the parent evaluator to call to indicate truth value
evalObserverNode - is the factory node associated to the state
Method Detail

removeMatch

public void removeMatch(java.util.Set<EventBean> matchEvent)
Description copied from class: EvalStateNode
Remove matches that overlap with the provided events.

Specified by:
removeMatch in class EvalStateNode
Parameters:
matchEvent - set of events to check for

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

getContext

public PatternAgentInstanceContext getContext()
Specified by:
getContext in interface ObserverEventEvaluator

observerEvaluateTrue

public void observerEvaluateTrue(MatchedEventMap matchEvent,
                                 boolean quitted)
Description copied from interface: ObserverEventEvaluator
Indicate an event for evaluation (sub-expression the observer represents has turned true).

Specified by:
observerEvaluateTrue in interface ObserverEventEvaluator
Parameters:
matchEvent - is the matched events so far
quitted - whether the observer quit, usually "true" for most observers

observerEvaluateFalse

public void observerEvaluateFalse(boolean restartable)
Description copied from interface: ObserverEventEvaluator
Indicate that the observer turned permanently false.

Specified by:
observerEvaluateFalse in interface ObserverEventEvaluator

start

public 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

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

accept

public final void accept(EvalStateNodeVisitor visitor)
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

isNotOperator

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

isFilterStateNode

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

isObserverStateNodeNonRestarting

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

toString

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

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