Last update: 2011-06-23

org.proteios.core.query
Class Aggregations

java.lang.Object
  extended by org.proteios.core.query.Aggregations

public class Aggregations
extends Object

A factory class to create aggregate expressions.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2009-04-09 08:48:11 +0200 (Thu, 09 Apr 2009) $

Constructor Summary
Aggregations()
           
 
Method Summary
static Expression count(Expression e, boolean distinct)
          Calculates the number of values for an expression: new expression = COUNT(e)
static Expression max(Expression e)
          Calculates the maximum value of an expression: new expression = MAX(e)
static Expression mean(Expression e)
          Calculates the mean of all values for an expression: new expression = AVG(e)
static Expression min(Expression e)
          Calculates the minimum value of an expression: new expression = MIN(e)
static Expression sum(Expression e)
          Calculates the sum of all values of an expression: new expression = SUM(e)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Aggregations

public Aggregations()
Method Detail

count

public static Expression count(Expression e,
                               boolean distinct)
Calculates the number of values for an expression: new expression = COUNT(e)

Parameters:
e - The expression to count, or null to count all rows (ie. COUNT(*))
distinct - If only distinct values should be counted
Returns:
The new Expression

max

public static Expression max(Expression e)
                      throws InvalidDataException
Calculates the maximum value of an expression: new expression = MAX(e)

Parameters:
e - The expression to use in the calculation
Returns:
The new Expression
Throws:
InvalidDataException - If the expression is null

min

public static Expression min(Expression e)
                      throws InvalidDataException
Calculates the minimum value of an expression: new expression = MIN(e)

Parameters:
e - The expression to use in the calculation
Returns:
The new Expression
Throws:
InvalidDataException - If the expression is null

mean

public static Expression mean(Expression e)
                       throws InvalidDataException
Calculates the mean of all values for an expression: new expression = AVG(e)

Parameters:
e - The expression to use in the calculation
Returns:
The new Expression
Throws:
InvalidDataException - If the expression is null

sum

public static Expression sum(Expression e)
                      throws InvalidDataException
Calculates the sum of all values of an expression: new expression = SUM(e)

Parameters:
e - The expression to use in the calculation
Returns:
The new Expression
Throws:
InvalidDataException - If the expression is null

Last update: 2011-06-23