Class RawResultNode

    • Field Summary

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

      Constructors 
      Constructor Description
      RawResultNode()
      Constructs an empty result node.
      RawResultNode​(byte[] value)
      Constructs an instance of this class with given byte buffer.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(ResultNode rhs)
      In-place addition of this result with another.
      RawResultNode clone()  
      double getFloat()
      Returns the float representation of this result.
      long getInteger()
      Returns the integer representation of this result.
      static RawResultNode getNegativeInfinity()
      Will provide the smallest possible value
      static PositiveInfinityResultNode getPositiveInfinity()
      Will provide the largest possible value
      byte[] getRaw()
      Returns the raw byte array representation of this result.
      String getString()
      Returns the string representation of this result.
      Object getValue()
      Return a java native, either String, Double or Long, depending on the underlying container.
      int hashCode()  
      void max​(ResultNode rhs)
      Swaps the numerical value of this node with the larger of this and the other.
      void min​(ResultNode rhs)
      Swaps the numerical value of this node with the smaller of this and the other.
      void negate()
      Negate the value contained within the result node.
      protected int onCmp​(ResultNode rhs)
      This method must be implemented by all subclasses of this to allow ordering of results.
      protected void onDeserialize​(com.yahoo.vespa.objects.Deserializer buf)  
      protected int onGetClassId()  
      protected void onSerialize​(com.yahoo.vespa.objects.Serializer buf)  
      void set​(ResultNode rhs)
      This method must be implemented by all subclasses of this to allow new results to be calculated.
      RawResultNode setValue​(byte[] value)
      Sets the value of this result.
      String toString()  
      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, putUtf8, registerClass, serialize, serializeOptional, serializeWithId
      • Methods inherited from class com.yahoo.vespa.objects.Selectable

        select, select, selectMembers
    • Field Detail

      • classId

        public static final int classId
    • Constructor Detail

      • RawResultNode

        public RawResultNode()
        Constructs an empty result node. NOTE: This instance is broken until non-optional member data is set.
      • RawResultNode

        public RawResultNode​(byte[] value)
        Constructs an instance of this class with given byte buffer.
        Parameters:
        value - The value to assign to this.
    • Method Detail

      • setValue

        public RawResultNode setValue​(byte[] value)
        Sets the value of this result.
        Parameters:
        value - The value to set.
        Returns:
        This, to allow chaining.
      • 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
      • getInteger

        public long getInteger()
        Description copied from class: ResultNode
        Returns the integer representation of this result.
        Specified by:
        getInteger in class ResultNode
        Returns:
        The value of this.
      • getFloat

        public double getFloat()
        Description copied from class: ResultNode
        Returns the float representation of this result.
        Specified by:
        getFloat in class ResultNode
        Returns:
        The value of this.
      • getString

        public String getString()
        Description copied from class: ResultNode
        Returns the string representation of this result.
        Specified by:
        getString in class ResultNode
        Returns:
        The value of this.
      • getRaw

        public byte[] getRaw()
        Description copied from class: ResultNode
        Returns the raw byte array representation of this result.
        Specified by:
        getRaw in class ResultNode
        Returns:
        The value of this.
      • toString

        public String toString()
        Overrides:
        toString in class com.yahoo.vespa.objects.Identifiable
      • onCmp

        protected int onCmp​(ResultNode rhs)
        Description copied from class: ResultNode
        This method must be implemented by all subclasses of this to allow ordering of results. This method is used by the Cloneable implementation.
        Specified by:
        onCmp in class ResultNode
        Parameters:
        rhs - The other node to compare with.
        Returns:
        Comparable result.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class com.yahoo.vespa.objects.Identifiable
      • clone

        public RawResultNode clone()
        Overrides:
        clone 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
      • add

        public void add​(ResultNode rhs)
        Description copied from class: SingleResultNode
        In-place addition of this result with another.
        Specified by:
        add in class SingleResultNode
        Parameters:
        rhs - The result to add to this.
      • min

        public void min​(ResultNode rhs)
        Description copied from class: SingleResultNode
        Swaps the numerical value of this node with the smaller of this and the other.
        Specified by:
        min in class SingleResultNode
        Parameters:
        rhs - The other result to evaluate.
      • max

        public void max​(ResultNode rhs)
        Description copied from class: SingleResultNode
        Swaps the numerical value of this node with the larger of this and the other.
        Specified by:
        max in class SingleResultNode
        Parameters:
        rhs - The other result to evaluate.
      • getValue

        public Object getValue()
        Description copied from class: SingleResultNode
        Return a java native, either String, Double or Long, depending on the underlying container.
        Specified by:
        getValue in class SingleResultNode
        Returns:
        The underlying numeric value.
      • set

        public void set​(ResultNode rhs)
        Description copied from class: ResultNode
        This method must be implemented by all subclasses of this to allow new results to be calculated.
        Specified by:
        set in class ResultNode
        Parameters:
        rhs - The node to get the result from.
      • negate

        public void negate()
        Description copied from class: ResultNode
        Negate the value contained within the result node.
        Overrides:
        negate in class ResultNode
      • getNegativeInfinity

        public static RawResultNode getNegativeInfinity()
        Will provide the smallest possible value
        Returns:
        the smallest possible IntegerResultNode
      • getPositiveInfinity

        public static PositiveInfinityResultNode getPositiveInfinity()
        Will provide the largest possible value
        Returns:
        the smallest largest IntegerResultNode