org.datanucleus.jdo.query
Class ExpressionImpl<T>

java.lang.Object
  extended by org.datanucleus.jdo.query.ExpressionImpl<T>
All Implemented Interfaces:
Expression<T>
Direct Known Subclasses:
CollectionExpressionImpl, ComparableExpressionImpl, MapExpressionImpl, ObjectExpressionImpl, PersistableExpressionImpl

public class ExpressionImpl<T>
extends java.lang.Object
implements Expression<T>

Implementation of the methods for Expression, to be extended by the XXXExpressionImpl classes.


Constructor Summary
ExpressionImpl(java.lang.Class<T> cls, java.lang.String name, ExpressionType type)
          Constructor for a parameter or variable of this type.
ExpressionImpl(Expression queryExpr)
          Constructor taking in the query expression being represented.
ExpressionImpl(PersistableExpression parent, java.lang.String name)
          Constructor, extending a parent, and accessing a member of that parent.
 
Method Summary
 Expression cast(java.lang.Class cls)
          Return an expression where this expression is cast to the specified type.
 NumericExpression<java.lang.Long> count()
          Method to return a numeric expression representing the aggregated count of this expression.
 NumericExpression<java.lang.Long> countDistinct()
          Method to return a numeric expression representing the aggregated (distinct) count of this expression.
 BooleanExpression eq(Expression expr)
          Method returning whether this expression equals the other expression.
 BooleanExpression eq(T t)
          Method returning whether this expression equals the literal.
 Expression getQueryExpression()
          Accessor for the underlying (generic) query expression.
 BooleanExpression instanceOf(java.lang.Class cls)
          Return an expression for whether this expression is an instanceof the supplied class.
 boolean isParameter()
           
 boolean isVariable()
           
 BooleanExpression ne(Expression expr)
          Method returning whether this expression doesn't equal the other expression.
 BooleanExpression ne(T t)
          Method returning whether this expression doesn't equal the literal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionImpl

public ExpressionImpl(PersistableExpression parent,
                      java.lang.String name)
Constructor, extending a parent, and accessing a member of that parent.

Parameters:
parent - The parent expression (or null, if candidate)
name - Name of the member to access

ExpressionImpl

public ExpressionImpl(java.lang.Class<T> cls,
                      java.lang.String name,
                      ExpressionType type)
Constructor for a parameter or variable of this type.

Parameters:
cls - The type of the parameter/variable
name - Name of the member to access
type - The type, whether parameter or variable

ExpressionImpl

public ExpressionImpl(Expression queryExpr)
Constructor taking in the query expression being represented.

Parameters:
queryExpr - The (generic) query expression
Method Detail

getQueryExpression

public Expression getQueryExpression()
Accessor for the underlying (generic) query expression.

Returns:
The query expression

isParameter

public boolean isParameter()

isVariable

public boolean isVariable()

eq

public BooleanExpression eq(Expression expr)
Description copied from interface: Expression
Method returning whether this expression equals the other expression.

Specified by:
eq in interface Expression<T>
Parameters:
expr - Other expression
Returns:
Whether they are equal

eq

public BooleanExpression eq(T t)
Description copied from interface: Expression
Method returning whether this expression equals the literal.

Specified by:
eq in interface Expression<T>
Parameters:
t - Literal
Returns:
Whether they are equal

ne

public BooleanExpression ne(Expression expr)
Description copied from interface: Expression
Method returning whether this expression doesn't equal the other expression.

Specified by:
ne in interface Expression<T>
Parameters:
expr - Other expression
Returns:
Whether they are not equal

ne

public BooleanExpression ne(T t)
Description copied from interface: Expression
Method returning whether this expression doesn't equal the literal.

Specified by:
ne in interface Expression<T>
Parameters:
t - literal
Returns:
Whether they are not equal

instanceOf

public BooleanExpression instanceOf(java.lang.Class cls)
Description copied from interface: Expression
Return an expression for whether this expression is an instanceof the supplied class.

Specified by:
instanceOf in interface Expression<T>
Parameters:
cls - Class to check against
Returns:
Whether it is an instanceof

cast

public Expression cast(java.lang.Class cls)
Description copied from interface: Expression
Return an expression where this expression is cast to the specified type.

Specified by:
cast in interface Expression<T>
Parameters:
cls - Class to cast to
Returns:
The cast expression

count

public NumericExpression<java.lang.Long> count()
Description copied from interface: Expression
Method to return a numeric expression representing the aggregated count of this expression.

Specified by:
count in interface Expression<T>
Returns:
Numeric expression for the count

countDistinct

public NumericExpression<java.lang.Long> countDistinct()
Description copied from interface: Expression
Method to return a numeric expression representing the aggregated (distinct) count of this expression.

Specified by:
countDistinct in interface Expression<T>
Returns:
Numeric expression for the distinct count


Copyright © 2011. All Rights Reserved.