Class EvalGuardStateNode

java.lang.Object
com.espertech.esper.common.internal.epl.pattern.core.EvalStateNode
com.espertech.esper.common.internal.epl.pattern.guard.EvalGuardStateNode
All Implemented Interfaces:
Evaluator, Quitable

public class EvalGuardStateNode extends EvalStateNode implements Evaluator, Quitable
This class represents the state of a "within" operator in the evaluation state tree. The within operator applies to a subexpression and is thus expected to only have one child node.
  • Field Details

  • Constructor Details

    • EvalGuardStateNode

      public EvalGuardStateNode(Evaluator parentNode, EvalGuardNode evalGuardNode)
      Constructor.
      Parameters:
      parentNode - is the parent evaluator to call to indicate truth value
      evalGuardNode - is the factory node associated to the state
  • Method Details

    • removeMatch

      public void removeMatch(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()
      Description copied from interface: Quitable
      Retains the pattern context with relevant pattern and statement-level services.

      The pattern context is the same context as provided to the guard factory and is provided by the quitable so the guard instance does not need to retain the pattern context.

      Specified by:
      getContext in interface Quitable
      Returns:
      pattern context
    • 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
      Parameters:
      beginState - begin state
    • 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 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
      optionalTriggeringEvent - in case the truth value changed to true in direct response to an event arriving, provides that event
    • evaluateFalse

      public final void evaluateFalse(EvalStateNode fromNode, boolean restartable)
      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
      restartable - whether the evaluator can be restarted
    • 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
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • isNotOperator

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

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

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

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

      public void guardQuit()
      Description copied from interface: Quitable
      Indicate guard quitted.
      Specified by:
      guardQuit in interface Quitable