Package generic.expressions

# Enum Class ExpressionOperator

java.lang.Object
java.lang.Enum<ExpressionOperator>
generic.expressions.ExpressionOperator

All Implemented Interfaces:
  `ExpressionElement`, `Serializable`, `Comparable<ExpressionOperator>`, `Constable`

public enum ExpressionOperator extends Enum<ExpressionOperator> implements ExpressionElement
Enum of support operators for the `ExpressionEvaluator`

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `ADD`
  `BITWISE_AND`
  `BITWISE_NOT`
  `BITWISE_OR`
  `BITWISE_XOR`
  `DIVIDE`
  `EQUALS`
  `GREATER_THAN`
  `GREATER_THAN_OR_EQUAL`
  `LESS_THAN`
  `LESS_THAN_OR_EQUAL`
  `LOGICAL_AND`
  `LOGICAL_NOT`
  `LOGICAL_OR`
  `MULTIPLY`
  `NOT_EQUALS`
  `SHIFT_LEFT`
  `SHIFT_RIGHT`
  `SUBTRACT`
  `UNARY_MINUS`
  `UNARY_PLUS`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static List<Set<ExpressionOperator>>`
  `binaryOperatorsByPrecedence`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static List<Set<ExpressionOperator>>`
  `getBinaryOperatorsByPrecedence()`
  Returns a list of all the binary operators in precedence order, organized into sets where each set contains all the operators of the same precedence.
  `static ExpressionOperator`
  `getOperator(String token, String lookahead1, boolean preferBinary)`
  Returns the operator for the given token and look ahead token and if we are expecting to find a binary operator.
  `boolean`
  `isBinary()`
  Returns if the operator is a binary operator.
  `boolean`
  `isUnary()`
  Returns if the operator is a unary operator.
  `int`
  `size()`
  Returns the number of chars in the operator
  `String`
  `toString()`
  `static ExpressionOperator`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static ExpressionOperator[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

  ### Methods inherited from class java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### BITWISE_NOT

    public static final ExpressionOperator BITWISE_NOT

  - ### LOGICAL_NOT

    public static final ExpressionOperator LOGICAL_NOT

  - ### UNARY_PLUS

    public static final ExpressionOperator UNARY_PLUS

  - ### UNARY_MINUS

    public static final ExpressionOperator UNARY_MINUS

  - ### MULTIPLY

    public static final ExpressionOperator MULTIPLY

  - ### DIVIDE

    public static final ExpressionOperator DIVIDE

  - ### ADD

    public static final ExpressionOperator ADD

  - ### SUBTRACT

    public static final ExpressionOperator SUBTRACT

  - ### SHIFT_LEFT

    public static final ExpressionOperator SHIFT_LEFT

  - ### SHIFT_RIGHT

    public static final ExpressionOperator SHIFT_RIGHT

  - ### LESS_THAN

    public static final ExpressionOperator LESS_THAN

  - ### GREATER_THAN

    public static final ExpressionOperator GREATER_THAN

  - ### LESS_THAN_OR_EQUAL

    public static final ExpressionOperator LESS_THAN_OR_EQUAL

  - ### GREATER_THAN_OR_EQUAL

    public static final ExpressionOperator GREATER_THAN_OR_EQUAL

  - ### EQUALS

    public static final ExpressionOperator EQUALS

  - ### NOT_EQUALS

    public static final ExpressionOperator NOT_EQUALS

  - ### BITWISE_AND

    public static final ExpressionOperator BITWISE_AND

  - ### BITWISE_XOR

    public static final ExpressionOperator BITWISE_XOR

  - ### BITWISE_OR

    public static final ExpressionOperator BITWISE_OR

  - ### LOGICAL_AND

    public static final ExpressionOperator LOGICAL_AND

  - ### LOGICAL_OR

    public static final ExpressionOperator LOGICAL_OR

- ## Field Details

  - ### binaryOperatorsByPrecedence

    public static List<Set<ExpressionOperator>> binaryOperatorsByPrecedence

- ## Method Details

  - ### values

    public static ExpressionOperator[] 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 ExpressionOperator 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

  - ### toString

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

  - ### getBinaryOperatorsByPrecedence

    public static List<Set<ExpressionOperator>> getBinaryOperatorsByPrecedence()
    Returns a list of all the binary operators in precedence order, organized into sets where each set contains all the operators of the same precedence.
    Returns:
      a list of all the binary operators in precedence order, organized into sets where each set contains all the operators of the same precedence.

  - ### getOperator

    public static ExpressionOperator getOperator(String token, String lookahead1, boolean preferBinary)
    Returns the operator for the given token and look ahead token and if we are expecting to find a binary operator. This method first tries merging the tokens looking for a double char operator first.
    Parameters:
      `token` - the first token
      `lookahead1` - the next token that may or may not be part of this operand
      `preferBinary` - if we are expecting a binary operator (the previous expression element was an operand value). We need this to know if the token '-' is the unary operator or the binary operator. If the token before was an operator, then we expect a unary operator. If the previous was a value, then we expect a binary operator.
    Returns:
      the operator that matches the given tokens and expected type

  - ### size

    public int size()
    Returns the number of chars in the operator
    Returns:
      the number of chars in the operator

  - ### isUnary

    public boolean isUnary()
    Returns if the operator is a unary operator.
    Returns:
      if the operator is a unary operator.

  - ### isBinary

    public boolean isBinary()
    Returns if the operator is a binary operator.
    Returns:
      if the operator is a binary operator.