org.datanucleus.query.expression
Class Expression.DyadicOperator

java.lang.Object
  extended by org.datanucleus.query.expression.Expression.Operator
      extended by org.datanucleus.query.expression.Expression.DyadicOperator
Enclosing class:
Expression

public static class Expression.DyadicOperator
extends Expression.Operator

"Dyadic" operator performs operation on one or two operands.


Field Summary
 
Fields inherited from class org.datanucleus.query.expression.Expression.Operator
precedence, symbol
 
Constructor Summary
Expression.DyadicOperator(java.lang.String symbol, int precedence, boolean isAssociative)
          Dyadic operator
 
Method Summary
 boolean isHigherThanLeftSide(Expression.Operator op)
          Checks if this operation is higher than operator op in left side of the expression
 boolean isHigherThanRightSide(Expression.Operator op)
          Checks if this operation is higher than operator op in right side of the expression
 
Methods inherited from class org.datanucleus.query.expression.Expression.Operator
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Expression.DyadicOperator

public Expression.DyadicOperator(java.lang.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 Detail

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


Copyright © 2010. All Rights Reserved.