Class ResultNode

java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.objects.Identifiable
com.yahoo.searchlib.expression.ResultNode
All Implemented Interfaces:
Cloneable, Comparable<ResultNode>
Direct Known Subclasses:
BoolResultNode, BucketResultNode, NullResultNode, PositiveInfinityResultNode, ResultNodeVector, SingleResultNode

public abstract class ResultNode extends com.yahoo.vespa.objects.Identifiable implements Comparable<ResultNode>
This abstract expression node represents the result value of execution.
Author:
baldersheim, Simon Thoresen Hult
  • Field Summary

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
     
    boolean
     
    abstract double
    Returns the float representation of this result.
    abstract long
    Returns the integer representation of this result.
    abstract byte[]
    Returns the raw byte array representation of this result.
    abstract String
    Returns the string representation of this result.
    void
    Negate the value contained within the result node.
    protected abstract int
    This method must be implemented by all subclasses of this to allow ordering of results.
    protected int
     
    protected abstract void
    This method must be implemented by all subclasses of this to allow new results to be calculated.

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

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

    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

    • ResultNode

      public ResultNode()
  • Method Details

    • onGetClassId

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

      public final int compareTo(ResultNode b)
      Specified by:
      compareTo in interface Comparable<ResultNode>
    • equals

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

      protected abstract void set(ResultNode rhs)
      This method must be implemented by all subclasses of this to allow new results to be calculated.
      Parameters:
      rhs - The node to get the result from.
    • onCmp

      protected abstract int onCmp(ResultNode rhs)
      This method must be implemented by all subclasses of this to allow ordering of results. This method is used by the Cloneable implementation.
      Parameters:
      rhs - The other node to compare with.
      Returns:
      Comparable result.
    • getInteger

      public abstract long getInteger()
      Returns the integer representation of this result.
      Returns:
      The value of this.
    • getFloat

      public abstract double getFloat()
      Returns the float representation of this result.
      Returns:
      The value of this.
    • getString

      public abstract String getString()
      Returns the string representation of this result.
      Returns:
      The value of this.
    • getRaw

      public abstract byte[] getRaw()
      Returns the raw byte array representation of this result.
      Returns:
      The value of this.
    • negate

      public void negate()
      Negate the value contained within the result node.