Package com.yahoo.searchlib.expression
Class NumericResultNode
- java.lang.Object
-
- com.yahoo.vespa.objects.Selectable
-
- com.yahoo.vespa.objects.Identifiable
-
- com.yahoo.searchlib.expression.ResultNode
-
- com.yahoo.searchlib.expression.SingleResultNode
-
- com.yahoo.searchlib.expression.NumericResultNode
-
- All Implemented Interfaces:
Cloneable
,Comparable<ResultNode>
- Direct Known Subclasses:
FloatResultNode
,Int16ResultNode
,Int32ResultNode
,Int8ResultNode
,IntegerResultNode
public abstract class NumericResultNode extends SingleResultNode
This is a superclass for all numerical results.- Author:
- baldersheim, Simon Thoresen Hult
-
-
Field Summary
Fields Modifier and Type Field Description static int
classId
-
Constructor Summary
Constructors Constructor Description NumericResultNode()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
divide(ResultNode rhs)
In-place division of this result with another.abstract Object
getNumber()
Return a java numeric, either Double or Long, depending on the underlying container.Object
getValue()
Return a java native, either String, Double or Long, depending on the underlying container.abstract void
modulo(ResultNode rhs)
In-place modulo of this result with another.abstract void
multiply(ResultNode rhs)
In-place multiplication of this result with another.protected int
onGetClassId()
-
Methods inherited from class com.yahoo.searchlib.expression.SingleResultNode
add, max, min
-
Methods inherited from class com.yahoo.searchlib.expression.ResultNode
compareTo, equals, getFloat, getInteger, getRaw, getString, negate, onCmp, set
-
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
-
multiply
public abstract void multiply(ResultNode rhs)
In-place multiplication of this result with another.- Parameters:
rhs
- The result to multiply with this.
-
divide
public abstract void divide(ResultNode rhs)
In-place division of this result with another.- Parameters:
rhs
- The result to divide this by.
-
modulo
public abstract void modulo(ResultNode rhs)
In-place modulo of this result with another.- Parameters:
rhs
- The result to modulo this with.
-
getNumber
public abstract Object getNumber()
Return a java numeric, either Double or Long, depending on the underlying container.- Returns:
- The underlying numeric value.
-
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 classSingleResultNode
- Returns:
- The underlying numeric value.
-
onGetClassId
protected int onGetClassId()
- Overrides:
onGetClassId
in classResultNode
-
-