org.apache.torque.util.functions
Class Avg

java.lang.Object
  extended by org.apache.torque.util.functions.AggregateFunction
      extended by org.apache.torque.util.functions.Avg
All Implemented Interfaces:
Column, SQLFunction

public class Avg
extends AggregateFunction

SQL99 Standard Average function.

Version:
$Id: Avg.java 1448414 2013-02-20 21:06:35Z tfischer $

Constructor Summary
Avg(Column column)
          Construct an AVG function class with the column to average over.
Avg(Column column, boolean distinct)
          Construct an AVG function class with the column to average over and possibly a distinct modifier.
Avg(String sqlExpression)
          Construct an AVG function class with an SQL expression to average over.
 
Method Summary
 void setFunction(String function)
          This method cannot be called, an UnsupportedOperationException will always be thrown.
 
Methods inherited from class org.apache.torque.util.functions.AggregateFunction
getArgument, getArguments, getColumn, getColumnName, getFullTableName, getFunction, getSchemaName, getSqlExpression, getTableName, isDistinct, setArguments, setColumn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Avg

public Avg(Column column)
Construct an AVG function class with the column to average over.

Parameters:
column - the Column to average over.

Avg

public Avg(String sqlExpression)
Construct an AVG function class with an SQL expression to average over.

Parameters:
sqlExpression - the SQL expression to average over.

Avg

public Avg(Column column,
           boolean distinct)
Construct an AVG function class with the column to average over and possibly a distinct modifier.

Parameters:
column - the Column to average over.
distinct - whether to average only over distinct values.
Method Detail

setFunction

public void setFunction(String function)
This method cannot be called, an UnsupportedOperationException will always be thrown.

Overrides:
setFunction in class AggregateFunction
Parameters:
function - disregarded.
Throws:
UnsupportedOperationException - always.


Copyright © 2000-2013 The Apache Software Foundation. All Rights Reserved.