org.datanucleus.query.expression
Class PrimaryExpression

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

public class PrimaryExpression
extends Expression

Expression for a primary object. This may be a field, or an explicit variable/parameter, or a field invoked on an expression.


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
alias, left, LOCALISER, op, OP_ADD, OP_AND, OP_CAST, 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_NOTIN, OP_OR, OP_SUB, parent, right, symbol
 
Constructor Summary
PrimaryExpression(Expression left, java.util.List<java.lang.String> tuples)
          PrimaryExpression on an expression.
PrimaryExpression(java.util.List<java.lang.String> tuples)
          PrimaryExpression made up of a series of field names.
 
Method Summary
 Symbol bind(SymbolTable symtbl)
          Method to bind the expression to the symbol table as appropriate.
 java.lang.String getId()
          Accessor for the expression "id".
 java.util.List<java.lang.String> getTuples()
           
 java.lang.String toString()
          Accessor for string form of the expression.
 
Methods inherited from class org.datanucleus.query.expression.Expression
evaluate, getAlias, getLeft, getOperator, getParent, getRight, getSymbol, setAlias, setLeft, setRight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrimaryExpression

public PrimaryExpression(java.util.List<java.lang.String> tuples)
PrimaryExpression made up of a series of field names. e.g "a.b.c"

Parameters:
tuples - The components of the expression

PrimaryExpression

public PrimaryExpression(Expression left,
                         java.util.List<java.lang.String> tuples)
PrimaryExpression on an expression. e.g "((B)a).c" so the left expression is a CastExpression, and the tuples are "c".

Parameters:
left - The left expression
tuples - The tuples of the primary
Method Detail

getId

public java.lang.String getId()
Accessor for the expression "id". This will be something like "a.b.c".

Returns:
The id

getTuples

public java.util.List<java.lang.String> getTuples()

bind

public Symbol bind(SymbolTable symtbl)
Method to bind the expression to the symbol table as appropriate.

Specified by:
bind in class Expression
Parameters:
symtbl - Symbol Table
Returns:
The symbol for this expression

toString

public java.lang.String toString()
Accessor for string form of the expression. Returns something like "PrimaryExpression {a.b.c}" when left is null, or "PrimaryExpression {ParameterExpression {a}.b.c}" when left is the ParameterExpression

Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.