Class BooleanValue
- java.lang.Object
-
- com.yahoo.searchlib.rankingexpression.evaluation.Value
-
- com.yahoo.searchlib.rankingexpression.evaluation.DoubleCompatibleValue
-
- com.yahoo.searchlib.rankingexpression.evaluation.BooleanValue
-
public class BooleanValue extends DoubleCompatibleValue
A value which is either true or false. In numerical context true is interpreted as 1 and false as 0.- Since:
- 5.1.21
- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description BooleanValue(boolean value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
asBoolean()
Returns this value as a boolean.double
asDouble()
Returns this value as a double, or throws UnsupportedOperationException if it cannot be represented as a doubleValue
asMutable()
Returns this is mutable, or a mutable copy otherwiseboolean
equals(java.lang.Object other)
static BooleanValue
frozen(boolean value)
Create a boolean value which is frozen at the outset.int
hashCode()
java.lang.String
toString()
-
Methods inherited from class com.yahoo.searchlib.rankingexpression.evaluation.DoubleCompatibleValue
add, and, asTensor, compare, divide, function, hasDouble, modulo, multiply, negate, not, or, power, subtract, type
-
Methods inherited from class com.yahoo.searchlib.rankingexpression.evaluation.Value
asDoubleValue, doubleAsTensor, freeze, isFrozen, isNaN, of, of, parse
-
-
-
-
Method Detail
-
frozen
public static BooleanValue frozen(boolean value)
Create a boolean value which is frozen at the outset.
-
asBoolean
public boolean asBoolean()
Description copied from class:Value
Returns this value as a boolean.
-
asDouble
public double asDouble()
Description copied from class:Value
Returns this value as a double, or throws UnsupportedOperationException if it cannot be represented as a double
-
asMutable
public Value asMutable()
Description copied from class:Value
Returns this is mutable, or a mutable copy otherwise
-
-