Package com.yahoo.searchlib.expression
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 int
classId
-
Constructor Summary
Constructors Constructor Description ResultNode()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(ResultNode b)
boolean
equals(Object obj)
abstract double
getFloat()
Returns the float representation of this result.abstract long
getInteger()
Returns the integer representation of this result.abstract byte[]
getRaw()
Returns the raw byte array representation of this result.abstract String
getString()
Returns the string representation of this result.void
negate()
Negate the value contained within the result node.protected abstract int
onCmp(ResultNode rhs)
This method must be implemented by all subclasses of this to allow ordering of results.protected int
onGetClassId()
protected abstract void
set(ResultNode rhs)
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
-
-
-
-
Method Detail
-
onGetClassId
protected int onGetClassId()
- Overrides:
onGetClassId
in classcom.yahoo.vespa.objects.Identifiable
-
compareTo
public final int compareTo(ResultNode b)
- Specified by:
compareTo
in interfaceComparable<ResultNode>
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classcom.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 theCloneable
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.
-
-