| org.h2.api.AggregateFunction
AggregateFunction | public interface AggregateFunction (Code) | | A user defined aggregate function needs to implement this interface.
The class must be public and must have a public non-argument constructor.
|
Method Summary | |
void | add(Object value) This method is called once for each row. | Object | getResult() This method returns the computed aggregate value. | int | getType(int[] inputType) This method must return the SQL type of the method,
given the SQL type of the input data. | void | init(Connection conn) This method is called when the aggregate function is used. |
add | void add(Object value) throws SQLException(Code) | | This method is called once for each row.
If the aggregate function is called with multiple parameters,
those are passed as array.
Parameters: value - the value(s) for this row |
getResult | Object getResult() throws SQLException(Code) | | This method returns the computed aggregate value.
the aggregated value |
getType | int getType(int[] inputType) throws SQLException(Code) | | This method must return the SQL type of the method,
given the SQL type of the input data.
The method should check here if the number of parameters passed is correct,
and if not it should throw an exception.
Parameters: inputType - the SQL type of the parameters the SQL type of the result |
init | void init(Connection conn) throws SQLException(Code) | | This method is called when the aggregate function is used.
A new object is created for each invocation.
Parameters: conn - a connection to the database |
|
|