Class StringValue
- java.lang.Object
-
- com.yahoo.searchlib.rankingexpression.evaluation.Value
-
- com.yahoo.searchlib.rankingexpression.evaluation.StringValue
-
public class StringValue extends Value
A string value.- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description StringValue(java.lang.String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Value
add(Value value)
Value
and(Value value)
boolean
asBoolean()
Returns this value as a boolean.double
asDouble()
Returns the hashcode of this, to enable strings to be encoded (with reasonable safely) as doubles for optimizationValue
asMutable()
Returns this is mutable, or a mutable copy otherwisejava.lang.String
asString()
Returns the value of this as a stringcom.yahoo.tensor.Tensor
asTensor()
Returns this as a tensor valueValue
compare(TruthOperator operator, Value value)
Perform the comparison specified by the operator between this value and the given valueValue
divide(Value value)
boolean
equals(java.lang.Object other)
static StringValue
frozen(java.lang.String value)
Create a string value which is frozen at the outset.Value
function(Function function, Value value)
Perform the given binary function on this value and the given valueboolean
hasDouble()
Returns true if this value can return itself as a double, i.e asDoubleValue will return a value and not throwint
hashCode()
Value
modulo(Value value)
Value
multiply(Value value)
Value
negate()
Value
not()
Value
or(Value value)
Value
power(Value value)
Value
subtract(Value value)
java.lang.String
toString()
com.yahoo.tensor.TensorType
type()
Returns the type of this value-
Methods inherited from class com.yahoo.searchlib.rankingexpression.evaluation.Value
asDoubleValue, doubleAsTensor, freeze, isFrozen, isNaN, of, of, parse
-
-
-
-
Method Detail
-
frozen
public static StringValue frozen(java.lang.String value)
Create a string value which is frozen at the outset.
-
type
public com.yahoo.tensor.TensorType type()
Description copied from class:Value
Returns the type of this value
-
asDouble
public double asDouble()
Returns the hashcode of this, to enable strings to be encoded (with reasonable safely) as doubles for optimization
-
asTensor
public com.yahoo.tensor.Tensor asTensor()
Description copied from class:Value
Returns this as a tensor value
-
hasDouble
public boolean hasDouble()
Description copied from class:Value
Returns true if this value can return itself as a double, i.e asDoubleValue will return a value and not throw
-
asBoolean
public boolean asBoolean()
Description copied from class:Value
Returns this value as a boolean.
-
compare
public Value compare(TruthOperator operator, Value value)
Description copied from class:Value
Perform the comparison specified by the operator between this value and the given value
-
function
public Value function(Function function, Value value)
Description copied from class:Value
Perform the given binary function on this value and the given value
-
asMutable
public Value asMutable()
Description copied from class:Value
Returns this is mutable, or a mutable copy otherwise
-
asString
public java.lang.String asString()
Returns the value of this as a string
-
-