Class ExpressionNode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    AggregationRefNode, AggregationResult, ConstantNode, DocumentAccessorNode, FunctionNode, RelevanceNode

    public abstract class ExpressionNode
    extends com.yahoo.vespa.objects.Identifiable
    implements java.io.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:
    Serialized Form
    • Field Summary

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

      Constructors 
      Constructor Description
      ExpressionNode()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      ExpressionNode clone()  
      boolean equals​(java.lang.Object obj)  
      protected abstract boolean equalsExpression​(ExpressionNode obj)  
      boolean execute()
      Execute expression.
      protected void executeIterative​(ResultNode arg, ResultNode result)
      Give an argument to this expression and store the result.
      abstract ResultNode getResult()
      Get the result of this expression.
      protected void onArgument​(ResultNode arg, ResultNode result)  
      protected void onDeserialize​(com.yahoo.vespa.objects.Deserializer buf)  
      protected boolean onExecute()  
      protected int onGetClassId()  
      protected void onPrepare()  
      protected void onSerialize​(com.yahoo.vespa.objects.Serializer buf)  
      void prepare()
      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, 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 Detail

      • classId

        public static final int classId
    • Constructor Detail

      • ExpressionNode

        public ExpressionNode()
    • Method Detail

      • 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()
      • 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​(java.lang.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.