Class ExpressionNode

java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.objects.Identifiable
com.yahoo.searchlib.expression.ExpressionNode
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
AggregationRefNode, AggregationResult, ConstantNode, DocumentAccessorNode, FunctionNode, RelevanceNode

public abstract class ExpressionNode extends com.yahoo.vespa.objects.Identifiable implements Serializable
This is the base class for all expression node types. There is no execution logic implemented in Java, since that all happens in the C++ backend. This class hierarchy is for building the expression tree to pass to the backend.
Author:
baldersheim, Simon Thoresen Hult
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    final boolean
     
    protected abstract boolean
     
    boolean
    Execute expression.
    protected void
    Give an argument to this expression and store the result.
    abstract ResultNode
    Get the result of this expression.
    protected void
     
    protected void
    onDeserialize(com.yahoo.vespa.objects.Deserializer buf)
     
    protected boolean
     
    protected int
     
    protected void
     
    protected void
    onSerialize(com.yahoo.vespa.objects.Serializer buf)
     
    void
    Prepare expression for execution.
    void
    visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
     

    Methods inherited from class com.yahoo.vespa.objects.Identifiable

    create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getRawUtf8Bytes, getUtf8, hashCode, putUtf8, registerClass, serialize, serializeOptional, serializeWithId, toString

    Methods inherited from class com.yahoo.vespa.objects.Selectable

    select, select, selectMembers

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • classId

      public static final int classId
  • Constructor Details

    • ExpressionNode

      public ExpressionNode()
  • Method Details

    • prepare

      public void prepare()
      Prepare expression for execution.
    • execute

      public boolean execute()
      Execute expression.
      Returns:
      true if successful, false if not.
    • executeIterative

      protected void executeIterative(ResultNode arg, ResultNode result)
      Give an argument to this expression and store the result.
      Parameters:
      arg - Argument to use for expression.
      result - Node to contain the result.
    • onExecute

      protected boolean onExecute()
    • onPrepare

      protected void onPrepare()
    • onArgument

      protected void onArgument(ResultNode arg, ResultNode result)
    • onGetClassId

      protected int onGetClassId()
      Overrides:
      onGetClassId in class com.yahoo.vespa.objects.Identifiable
    • onSerialize

      protected void onSerialize(com.yahoo.vespa.objects.Serializer buf)
      Overrides:
      onSerialize in class com.yahoo.vespa.objects.Identifiable
    • onDeserialize

      protected void onDeserialize(com.yahoo.vespa.objects.Deserializer buf)
      Overrides:
      onDeserialize in class com.yahoo.vespa.objects.Identifiable
    • visitMembers

      public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
      Overrides:
      visitMembers in class com.yahoo.vespa.objects.Identifiable
    • clone

      public ExpressionNode clone()
      Overrides:
      clone in class com.yahoo.vespa.objects.Identifiable
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class com.yahoo.vespa.objects.Identifiable
    • equalsExpression

      protected abstract boolean equalsExpression(ExpressionNode obj)
    • getResult

      public abstract ResultNode getResult()
      Get the result of this expression.
      Returns:
      the result as a ResultNode.