com.mysema.query.types.expr
Class ENumber<D extends Number & Comparable<?>>

java.lang.Object
  extended by com.mysema.query.types.expr.Expr<D>
      extended by com.mysema.query.types.expr.EComparableBase<D>
          extended by com.mysema.query.types.expr.ENumber<D>
Type Parameters:
D - Java type
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CNumber, ENumberConst, ONumber, PNumber, SumOver

public abstract class ENumber<D extends Number & Comparable<?>>
extends EComparableBase<D>

ENumber represents a numeric expression

Author:
tiwe
See Also:
Number, Serialized Form

Constructor Summary
ENumber(Class<? extends D> type)
           
 
Method Summary
 ENumber<D> abs()
          Get the absolute value of this expression
<N extends Number & Comparable<?>>
ENumber<D>
add(Expr<N> right)
          Get the sum of this and right
<N extends Number & Comparable<N>>
ENumber<D>
add(N right)
          Get the sum of this and right
 ENumber<Double> avg()
          Get the average value of this expression (aggregation)
<A extends Number & Comparable<?>>
EBoolean
between(A from, A to)
          Create a from < this < to expression
<A extends Number & Comparable<?>>
EBoolean
between(Expr<A> from, Expr<A> to)
          Create a from < this < to expression
 ENumber<Byte> byteValue()
          Get the byte expression of this numeric expression
<A extends Number & Comparable<? super A>>
ENumber<A>
castToNum(Class<A> type)
          Create a cast expression to the given numeric type
 ENumber<D> ceil()
          Returns the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer
<N extends Number & Comparable<?>>
ENumber<Double>
divide(Expr<N> right)
          Get the result of the operation this / right
<N extends Number & Comparable<?>>
ENumber<Double>
divide(N right)
          Get the result of the operation this / right
 ENumber<Double> doubleValue()
          Get the double expression of this numeric expression
 ENumber<Float> floatValue()
          Get the float expression of this numeric expression
 ENumber<D> floor()
          Returns the largest (closest to positive infinity) double value that is less than or equal to the argument and is equal to a mathematical integer.
<A extends Number & Comparable<?>>
EBoolean
goe(A right)
          Create a this >= right expression
<A extends Number & Comparable<?>>
EBoolean
goe(Expr<A> right)
          Create a this >= right expression
<A extends Number & Comparable<?>>
EBoolean
gt(A right)
          Create a this > right expression
<A extends Number & Comparable<?>>
EBoolean
gt(Expr<A> right)
          Create a this > right expression
 ENumber<Integer> intValue()
          Get the int expression of this numeric expression
<A extends Number & Comparable<?>>
EBoolean
loe(A right)
          Create a this <= right expression
<A extends Number & Comparable<?>>
EBoolean
loe(Expr<A> right)
          Create a this <= right expression
 ENumber<Long> longValue()
          Get the long expression of this numeric expression
<A extends Number & Comparable<?>>
EBoolean
lt(A right)
          Create a this < right expression
<A extends Number & Comparable<?>>
EBoolean
lt(Expr<A> right)
          Create a this < right expression
 ENumber<D> max()
          Get the maximum value of this expression (aggregation)
static
<A extends Number & Comparable<?>>
ENumber<A>
max(Expr<A> left, Expr<A> right)
          Return the greater of the given values
 ENumber<D> min()
          Get the minimum value of this expression (aggregation)
static
<A extends Number & Comparable<?>>
ENumber<A>
min(Expr<A> left, Expr<A> right)
          Return the smaller of the given values
<N extends Number & Comparable<?>>
ENumber<D>
multiply(Expr<N> right)
          Get the result of the operation this * right
<N extends Number & Comparable<N>>
ENumber<D>
multiply(N right)
          Get the result of the operation this * right
 ENumber<D> negate()
          Get the negation of this expression
<A extends Number & Comparable<?>>
EBoolean
notBetween(A from, A to)
           
<A extends Number & Comparable<?>>
EBoolean
notBetween(Expr<A> from, Expr<A> to)
           
static ENumber<Double> random()
          Returns the random expression
 ENumber<Integer> round()
          Returns the closest int to the argument.
 ENumber<Short> shortValue()
          Get the short expression of this numeric expression
 ENumber<Double> sqrt()
          Get the square root of this numeric expressions
<N extends Number & Comparable<?>>
ENumber<D>
subtract(Expr<N> right)
          Get the difference of this and right
<N extends Number & Comparable<?>>
ENumber<D>
subtract(N right)
          Get the difference of this and right
 ENumber<D> sum()
          Get the sum of this expression (aggregation)
 
Methods inherited from class com.mysema.query.types.expr.EComparableBase
asc, desc, stringValue
 
Methods inherited from class com.mysema.query.types.expr.Expr
accept, count, countAll, countDistinct, eq, eq, getType, hashCode, in, in, in, ne, ne, notIn, notIn, notIn, toString, when, when
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ENumber

public ENumber(Class<? extends D> type)
Method Detail

max

public static <A extends Number & Comparable<?>> ENumber<A> max(Expr<A> left,
                                                               Expr<A> right)
Return the greater of the given values

Returns:
max(left, right)

min

public static <A extends Number & Comparable<?>> ENumber<A> min(Expr<A> left,
                                                               Expr<A> right)
Return the smaller of the given values

Returns:
min(left, right)

random

public static ENumber<Double> random()
Returns the random expression

Returns:
random()

abs

public ENumber<D> abs()
Get the absolute value of this expression

Returns:
abs(this)

add

public <N extends Number & Comparable<?>> ENumber<D> add(Expr<N> right)
Get the sum of this and right

Parameters:
right -
Returns:
this + right

add

public <N extends Number & Comparable<N>> ENumber<D> add(N right)
Get the sum of this and right

Parameters:
right -
Returns:
this + right

avg

public ENumber<Double> avg()
Get the average value of this expression (aggregation)

Returns:
avg(this)

byteValue

public ENumber<Byte> byteValue()
Get the byte expression of this numeric expression

Returns:
this.byteValue()
See Also:
Number.byteValue()

castToNum

public <A extends Number & Comparable<? super A>> ENumber<A> castToNum(Class<A> type)
Description copied from class: EComparableBase
Create a cast expression to the given numeric type

Overrides:
castToNum in class EComparableBase<D extends Number & Comparable<?>>
Returns:

ceil

public ENumber<D> ceil()
Returns the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer

Returns:
ceil(this)
See Also:
Math.ceil(double)

divide

public <N extends Number & Comparable<?>> ENumber<Double> divide(Expr<N> right)
Get the result of the operation this / right

Parameters:
right -
Returns:
this / right

divide

public <N extends Number & Comparable<?>> ENumber<Double> divide(N right)
Get the result of the operation this / right

Parameters:
right -
Returns:
this / right

doubleValue

public ENumber<Double> doubleValue()
Get the double expression of this numeric expression

Returns:
this.doubleValue()
See Also:
Number.doubleValue()

floatValue

public ENumber<Float> floatValue()
Get the float expression of this numeric expression

Returns:
this.floatValue()
See Also:
Number.floatValue()

floor

public ENumber<D> floor()
Returns the largest (closest to positive infinity) double value that is less than or equal to the argument and is equal to a mathematical integer.

Returns:
floor(this)
See Also:
Math.floor(double)

goe

public final <A extends Number & Comparable<?>> EBoolean goe(A right)
Create a this >= right expression

Type Parameters:
A -
Parameters:
right - rhs of the comparison
Returns:
this >= right
See Also:
Comparable.compareTo(Object)

goe

public final <A extends Number & Comparable<?>> EBoolean goe(Expr<A> right)
Create a this >= right expression

Type Parameters:
A -
Parameters:
right - rhs of the comparison
Returns:
this >= right
See Also:
Comparable.compareTo(Object)

gt

public final <A extends Number & Comparable<?>> EBoolean gt(A right)
Create a this > right expression

Type Parameters:
A -
Parameters:
right - rhs of the comparison
Returns:
this > right
See Also:
Comparable.compareTo(Object)

between

public final <A extends Number & Comparable<?>> EBoolean between(A from,
                                                                A to)
Create a from < this < to expression

Type Parameters:
A -
Parameters:
from -
to -
Returns:

between

public final <A extends Number & Comparable<?>> EBoolean between(Expr<A> from,
                                                                Expr<A> to)
Create a from < this < to expression

Type Parameters:
A -
Parameters:
from -
to -
Returns:

notBetween

public final <A extends Number & Comparable<?>> EBoolean notBetween(A from,
                                                                   A to)
Parameters:
from -
to -
Returns:

notBetween

public final <A extends Number & Comparable<?>> EBoolean notBetween(Expr<A> from,
                                                                   Expr<A> to)
Parameters:
from -
to -
Returns:

gt

public final <A extends Number & Comparable<?>> EBoolean gt(Expr<A> right)
Create a this > right expression

Type Parameters:
A -
Parameters:
right - rhs of the comparison
Returns:
this > right
See Also:
Comparable.compareTo(Object)

intValue

public ENumber<Integer> intValue()
Get the int expression of this numeric expression

Returns:
this.intValue()
See Also:
Number.intValue()

loe

public final <A extends Number & Comparable<?>> EBoolean loe(A right)
Create a this <= right expression

Type Parameters:
A -
Parameters:
right - rhs of the comparison
Returns:
this <= right
See Also:
Comparable.compareTo(Object)

loe

public final <A extends Number & Comparable<?>> EBoolean loe(Expr<A> right)
Create a this <= right expression

Type Parameters:
A -
Parameters:
right - rhs of the comparison
Returns:
this <= right
See Also:
Comparable.compareTo(Object)

longValue

public ENumber<Long> longValue()
Get the long expression of this numeric expression

Returns:
this.longValue()
See Also:
Number.longValue()

lt

public final <A extends Number & Comparable<?>> EBoolean lt(A right)
Create a this < right expression

Type Parameters:
A -
Parameters:
right - rhs of the comparison
Returns:
this < right
See Also:
Comparable.compareTo(Object)

lt

public final <A extends Number & Comparable<?>> EBoolean lt(Expr<A> right)
Create a this < right expression

Type Parameters:
A -
Parameters:
right - rhs of the comparison
Returns:
this < right
See Also:
Comparable.compareTo(Object)

max

public ENumber<D> max()
Get the maximum value of this expression (aggregation)

Returns:
max(this)

min

public ENumber<D> min()
Get the minimum value of this expression (aggregation)

Returns:
min(this)

multiply

public <N extends Number & Comparable<?>> ENumber<D> multiply(Expr<N> right)
Get the result of the operation this * right

Parameters:
right -
Returns:
this * right

multiply

public <N extends Number & Comparable<N>> ENumber<D> multiply(N right)
Get the result of the operation this * right

Parameters:
right -
Returns:
this * right

negate

public ENumber<D> negate()
Get the negation of this expression

Returns:
this * -1

round

public ENumber<Integer> round()
Returns the closest int to the argument.

Returns:
round(this)
See Also:
Math.round(double), Math.round(float)

shortValue

public ENumber<Short> shortValue()
Get the short expression of this numeric expression

Returns:
this.shortValue()
See Also:
Number.shortValue()

sqrt

public ENumber<Double> sqrt()
Get the square root of this numeric expressions

Returns:
sqrt(this)

subtract

public <N extends Number & Comparable<?>> ENumber<D> subtract(Expr<N> right)
Get the difference of this and right

Parameters:
right -
Returns:
this - right

subtract

public <N extends Number & Comparable<?>> ENumber<D> subtract(N right)
Get the difference of this and right

Parameters:
right -
Returns:
this - right

sum

public ENumber<D> sum()
Get the sum of this expression (aggregation)

Returns:
sum(this)


Copyright © 2007-2010 Mysema Ltd. All Rights Reserved.