org.datanucleus.query.expression
Class DyadicExpression

java.lang.Object
  extended by org.datanucleus.query.expression.Expression
      extended by org.datanucleus.query.expression.DyadicExpression

public class DyadicExpression
extends Expression

Expression between two other expressions and an operation. For example, "this.myField < myValue" will become left = PrimaryExpression, right = Literal, op = Expression.OP_LT. A special case is where we have an expression like "!(condition)". In this case we become left = expression, right = null, op = Expression.OP_NOT.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.datanucleus.query.expression.Expression
Expression.DyadicOperator, Expression.MonadicOperator, Expression.Operator
 
Field Summary
 
Fields inherited from class org.datanucleus.query.expression.Expression
left, LOCALISER, lowestOperator, op, OP_ADD, OP_AND, OP_BETWEEN, OP_COM, OP_CONCAT, OP_DISTINCT, OP_DIV, OP_EQ, OP_GT, OP_GTEQ, OP_IN, OP_IS, OP_ISNOT, OP_LIKE, OP_LT, OP_LTEQ, OP_MOD, OP_MUL, OP_NEG, OP_NOT, OP_NOTEQ, OP_OR, OP_SUB, right, symbol
 
Constructor Summary
DyadicExpression(Expression.MonadicOperator op, Expression operand)
          Perform a function op on operand
DyadicExpression(Expression operand1, Expression.DyadicOperator op, Expression operand2)
          Performs a function on two arguments.
 
Method Summary
 Symbol bind()
           
 java.lang.Object evaluate(ExpressionEvaluator eval)
           
 java.lang.String toString()
           
 
Methods inherited from class org.datanucleus.query.expression.Expression
getLeft, getOperator, getRight, getSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DyadicExpression

public DyadicExpression(Expression.MonadicOperator op,
                        Expression operand)
Perform a function op on operand

Parameters:
op - operator
operand - operand

DyadicExpression

public DyadicExpression(Expression operand1,
                        Expression.DyadicOperator op,
                        Expression operand2)
Performs a function on two arguments. op(operand1,operand2) operand1 op operand2

Parameters:
operand1 - the first expression
op - the operator between operands
operand2 - the second expression
Method Detail

evaluate

public java.lang.Object evaluate(ExpressionEvaluator eval)
Specified by:
evaluate in class Expression

bind

public Symbol bind()
Specified by:
bind in class Expression

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.