org.datanucleus.query.typesafe
Interface ComparableExpression<T>

Type Parameters:
T - Java type being represented here
All Superinterfaces:
Expression<T>
All Known Subinterfaces:
BooleanExpression, ByteExpression, CharacterExpression, DateExpression<T>, DateTimeExpression<T>, EnumExpression<T>, NumericExpression<T>, StringExpression, TemporalExpression<T>, TimeExpression<T>
All Known Implementing Classes:
BooleanExpressionImpl, ByteExpressionImpl, CharacterExpressionImpl, ComparableExpressionImpl, DateExpressionImpl, DateTimeExpressionImpl, EnumExpressionImpl, NumericExpressionImpl, StringExpressionImpl, TimeExpressionImpl

public interface ComparableExpression<T>
extends Expression<T>

Representation of an expression for a Java type that implements java.lang.Comparable. Nore that the methods taking Expression as an argument could have been defined to take ComparableExpression but that would then have prevented code like

 NumericExpression param = (NumericExpression)tq.parameter("criticalValue", Double.class);
 tq.filter(cand.value.lt(param));
 
and we would have had to cast the parameter to NumericExpression


Method Summary
 OrderExpression asc()
          Method to return an order expression for this expression in ascending order.
 OrderExpression desc()
          Method to return an order expression for this expression in descending order.
 BooleanExpression gt(ComparableExpression expr)
          Method returning whether this expression is greater than the other expression.
 BooleanExpression gt(T t)
          Method returning whether this expression is greater than the literal.
 BooleanExpression gteq(ComparableExpression expr)
          Method returning whether this expression is greater than or equal the other expression.
 BooleanExpression gteq(T t)
          Method returning whether this expression is greater than or equal the literal.
 BooleanExpression lt(ComparableExpression expr)
          Method returning whether this expression is less than the other expression.
 BooleanExpression lt(T t)
          Method returning whether this expression is less than the literal.
 BooleanExpression lteq(ComparableExpression expr)
          Method returning whether this expression is less than or equal the other expression.
 BooleanExpression lteq(T t)
          Method returning whether this expression is less than or equal the literal.
 NumericExpression max()
          Method to return a numeric expression representing the aggregated maximum of this expression.
 NumericExpression min()
          Method to return a numeric expression representing the aggregated minimum of this expression.
 
Methods inherited from interface org.datanucleus.query.typesafe.Expression
cast, count, countDistinct, eq, eq, instanceOf, ne, ne
 

Method Detail

lt

BooleanExpression lt(ComparableExpression expr)
Method returning whether this expression is less than the other expression.

Parameters:
expr - Other expression
Returns:
Whether this is less than the other

lt

BooleanExpression lt(T t)
Method returning whether this expression is less than the literal.

Parameters:
t - literal
Returns:
Whether this is less than the other

lteq

BooleanExpression lteq(ComparableExpression expr)
Method returning whether this expression is less than or equal the other expression.

Parameters:
expr - Other expression
Returns:
Whether this is less than or equal the other

lteq

BooleanExpression lteq(T t)
Method returning whether this expression is less than or equal the literal.

Parameters:
t - literal
Returns:
Whether this is less than or equal the other

gt

BooleanExpression gt(ComparableExpression expr)
Method returning whether this expression is greater than the other expression.

Parameters:
expr - Other expression
Returns:
Whether this is greater than the other

gt

BooleanExpression gt(T t)
Method returning whether this expression is greater than the literal.

Parameters:
t - literal
Returns:
Whether this is greater than the other

gteq

BooleanExpression gteq(ComparableExpression expr)
Method returning whether this expression is greater than or equal the other expression.

Parameters:
expr - Other expression
Returns:
Whether this is greater than or equal to the other

gteq

BooleanExpression gteq(T t)
Method returning whether this expression is greater than or equal the literal.

Parameters:
t - literal
Returns:
Whether this is greater than or equal to the other

min

NumericExpression min()
Method to return a numeric expression representing the aggregated minimum of this expression.

Returns:
Numeric expression for the minimum

max

NumericExpression max()
Method to return a numeric expression representing the aggregated maximum of this expression.

Returns:
Numeric expression for the maximum

asc

OrderExpression asc()
Method to return an order expression for this expression in ascending order.

Returns:
The order expression

desc

OrderExpression desc()
Method to return an order expression for this expression in descending order.

Returns:
The order expression


Copyright © 2011. All Rights Reserved.