Enum TruthOperator
- java.lang.Object
-
- java.lang.Enum<TruthOperator>
-
- com.yahoo.searchlib.rankingexpression.rule.TruthOperator
-
- All Implemented Interfaces:
Serializable
,Comparable<TruthOperator>
public enum TruthOperator extends Enum<TruthOperator> implements Serializable
A mathematical operator- Author:
- bratseth
-
-
Enum Constant Summary
Enum Constants Enum Constant Description APPROX_EQUAL
EQUAL
LARGER
LARGEREQUAL
NOTEQUAL
SMALLER
SMALLEREQUAL
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
evaluate(double x, double y)
Perform the truth operation on the inputstatic TruthOperator
fromString(String string)
String
toString()
static TruthOperator
valueOf(String name)
Returns the enum constant of this type with the specified name.static TruthOperator[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SMALLER
public static final TruthOperator SMALLER
-
SMALLEREQUAL
public static final TruthOperator SMALLEREQUAL
-
EQUAL
public static final TruthOperator EQUAL
-
APPROX_EQUAL
public static final TruthOperator APPROX_EQUAL
-
LARGER
public static final TruthOperator LARGER
-
LARGEREQUAL
public static final TruthOperator LARGEREQUAL
-
NOTEQUAL
public static final TruthOperator NOTEQUAL
-
-
Method Detail
-
values
public static TruthOperator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TruthOperator c : TruthOperator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TruthOperator valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
evaluate
public abstract boolean evaluate(double x, double y)
Perform the truth operation on the input
-
toString
public String toString()
- Overrides:
toString
in classEnum<TruthOperator>
-
fromString
public static TruthOperator fromString(String string)
-
-