Class Expression.DyadicOperator

java.lang.Object
org.datanucleus.store.query.expression.Expression.Operator
org.datanucleus.store.query.expression.Expression.DyadicOperator
All Implemented Interfaces:
Serializable
Enclosing class:
Expression

public static class Expression.DyadicOperator extends Expression.Operator
"Dyadic" operator performs operation on one or two operands.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • isAssociative

      private final boolean isAssociative
      An associative operator is one for which parentheses can be inserted and removed without changing the meaning of the expression
  • Constructor Details

    • DyadicOperator

      public DyadicOperator(String symbol, int precedence, boolean isAssociative)
      Dyadic operator
      Parameters:
      symbol - the source text or symbol of an operator. e.g =, ==, +, /, >, <, etc
      precedence - the order of precedence where the expression is compiled
      isAssociative - true if associative operator. An associative operator is one for which parentheses can be inserted and removed without changing the meaning of the expression
  • Method Details

    • isHigherThanLeftSide

      public boolean isHigherThanLeftSide(Expression.Operator op)
      Checks if this operation is higher than operator op in left side of the expression
      Parameters:
      op - the operator in the left side of the expression
      Returns:
      true if this operation is higher than operator op in left side of the expression
    • isHigherThanRightSide

      public boolean isHigherThanRightSide(Expression.Operator op)
      Checks if this operation is higher than operator op in right side of the expression
      Parameters:
      op - the operator in the right side of the expression
      Returns:
      true if this operation is higher than operator op in right side of the expression