Enum Class Operator

java.lang.Object
java.lang.Enum<Operator>
com.yahoo.searchlib.rankingexpression.rule.Operator
All Implemented Interfaces:
Serializable, Comparable<Operator>, Constable

public enum Operator extends Enum<Operator>
A mathematical operator
Author:
bratseth
  • Enum Constant Details

    • or

      public static final Operator or
    • and

      public static final Operator and
    • largerOrEqual

      public static final Operator largerOrEqual
    • larger

      public static final Operator larger
    • smallerOrEqual

      public static final Operator smallerOrEqual
    • smaller

      public static final Operator smaller
    • approxEqual

      public static final Operator approxEqual
    • notEqual

      public static final Operator notEqual
    • equal

      public static final Operator equal
    • plus

      public static final Operator plus
    • minus

      public static final Operator minus
    • multiply

      public static final Operator multiply
    • divide

      public static final Operator divide
    • modulo

      public static final Operator modulo
    • power

      public static final Operator power
  • Field Details

    • operatorsByPrecedence

      public static final List<Operator> operatorsByPrecedence
      A list of all the operators in this in order of increasing precedence
  • Method Details

    • values

      public static Operator[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Operator valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • hasPrecedenceOver

      public boolean hasPrecedenceOver(Operator other)
      Returns true if this operator has precedence over the given operator
    • evaluate

      public final Value evaluate(Value x, Value y)
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Operator>