org.datanucleus.query.expression
Class Expression

java.lang.Object
  extended by org.datanucleus.query.expression.Expression
Direct Known Subclasses:
ClassExpression, CreatorExpression, DyadicExpression, InvokeExpression, JoinExpression, Literal, OrderExpression, ParameterExpression, PrimaryExpression, VariableExpression

public abstract class Expression
extends java.lang.Object

A Scalar expression in a Query. Used to compute values with a resulting type.


Nested Class Summary
protected static class Expression.DyadicOperator
          "Dyadic" operator performs operation on one or two operands
protected static class Expression.MonadicOperator
          "Monadic" operator performs a function on one operand.
static class Expression.Operator
          Inner class representing an Operator
 
Field Summary
protected  Expression left
           
protected static Localiser LOCALISER
          Localiser for messages
protected  Expression.Operator lowestOperator
           
protected  Expression.Operator op
           
static Expression.DyadicOperator OP_ADD
          ADD
static Expression.DyadicOperator OP_AND
          AND
static Expression.DyadicOperator OP_BETWEEN
          BETWEEN
static Expression.MonadicOperator OP_COM
          COM
static Expression.DyadicOperator OP_CONCAT
          CONCAT
static Expression.MonadicOperator OP_DISTINCT
          DISTINCT
static Expression.DyadicOperator OP_DIV
          DIV
static Expression.DyadicOperator OP_EQ
          EQ
static Expression.DyadicOperator OP_GT
          GT
static Expression.DyadicOperator OP_GTEQ
          GTEQ
static Expression.DyadicOperator OP_IN
          IN
static Expression.DyadicOperator OP_IS
          IS
static Expression.DyadicOperator OP_ISNOT
          ISNOT
static Expression.DyadicOperator OP_LIKE
          LIKE
static Expression.DyadicOperator OP_LT
          LT
static Expression.DyadicOperator OP_LTEQ
          LTEQ
static Expression.DyadicOperator OP_MOD
          MOD
static Expression.DyadicOperator OP_MUL
          MUL
static Expression.MonadicOperator OP_NEG
          NEG
static Expression.MonadicOperator OP_NOT
          NOT
static Expression.DyadicOperator OP_NOTEQ
          NOTEQ
static Expression.DyadicOperator OP_OR
          OR
static Expression.DyadicOperator OP_SUB
          SUB
protected  Expression right
           
protected  Symbol symbol
           
 
Constructor Summary
protected Expression()
          Constructor.
protected Expression(Expression.MonadicOperator op, Expression operand)
          Perform a function op on operand
protected Expression(Expression operand1, Expression.DyadicOperator op, Expression operand2)
          Performs a function on two arguments.
 
Method Summary
abstract  Symbol bind()
           
abstract  java.lang.Object evaluate(ExpressionEvaluator eval)
           
 Expression getLeft()
           
 Expression.Operator getOperator()
           
 Expression getRight()
           
 Symbol getSymbol()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Localiser for messages


op

protected Expression.Operator op

left

protected Expression left

right

protected Expression right

symbol

protected Symbol symbol

OP_OR

public static final Expression.DyadicOperator OP_OR
OR


OP_AND

public static final Expression.DyadicOperator OP_AND
AND


OP_NOT

public static final Expression.MonadicOperator OP_NOT
NOT


OP_EQ

public static final Expression.DyadicOperator OP_EQ
EQ


OP_NOTEQ

public static final Expression.DyadicOperator OP_NOTEQ
NOTEQ


OP_LT

public static final Expression.DyadicOperator OP_LT
LT


OP_LTEQ

public static final Expression.DyadicOperator OP_LTEQ
LTEQ


OP_GT

public static final Expression.DyadicOperator OP_GT
GT


OP_GTEQ

public static final Expression.DyadicOperator OP_GTEQ
GTEQ


OP_LIKE

public static final Expression.DyadicOperator OP_LIKE
LIKE


OP_BETWEEN

public static final Expression.DyadicOperator OP_BETWEEN
BETWEEN


OP_IS

public static final Expression.DyadicOperator OP_IS
IS


OP_ISNOT

public static final Expression.DyadicOperator OP_ISNOT
ISNOT


OP_IN

public static final Expression.DyadicOperator OP_IN
IN


OP_ADD

public static final Expression.DyadicOperator OP_ADD
ADD


OP_SUB

public static final Expression.DyadicOperator OP_SUB
SUB


OP_CONCAT

public static final Expression.DyadicOperator OP_CONCAT
CONCAT


OP_MUL

public static final Expression.DyadicOperator OP_MUL
MUL


OP_DIV

public static final Expression.DyadicOperator OP_DIV
DIV


OP_MOD

public static final Expression.DyadicOperator OP_MOD
MOD


OP_NEG

public static final Expression.MonadicOperator OP_NEG
NEG


OP_COM

public static final Expression.MonadicOperator OP_COM
COM


OP_DISTINCT

public static final Expression.MonadicOperator OP_DISTINCT
DISTINCT


lowestOperator

protected Expression.Operator lowestOperator
Constructor Detail

Expression

protected Expression()
Constructor.


Expression

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

Parameters:
op - operator
operand - operand

Expression

protected Expression(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 abstract java.lang.Object evaluate(ExpressionEvaluator eval)

getOperator

public Expression.Operator getOperator()

getLeft

public Expression getLeft()

getRight

public Expression getRight()

getSymbol

public Symbol getSymbol()

bind

public abstract Symbol bind()


Copyright © 2009. All Rights Reserved.