Package org.h2.test.scripts
Class Aggregate1
java.lang.Object
org.h2.test.scripts.Aggregate1
- All Implemented Interfaces:
Aggregate
An aggregate function for tests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method is called once for each row.intgetInternalType(int[] inputTypes) This method must return the H2 data type,Value, of the aggregate function, given the H2 data type of the input data.This method returns the computed aggregate value.
-
Constructor Details
-
Aggregate1
public Aggregate1()
-
-
Method Details
-
getInternalType
Description copied from interface:AggregateThis method must return the H2 data type,Value, of the aggregate function, given the H2 data 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.- Specified by:
getInternalTypein interfaceAggregate- Parameters:
inputTypes- the H2 data type of the parameters,- Returns:
- the H2 data type of the result
- Throws:
SQLException- if the number/type of parameters passed is incorrect
-
add
Description copied from interface:AggregateThis method is called once for each row. If the aggregate function is called with multiple parameters, those are passed as array.- Specified by:
addin interfaceAggregate- Parameters:
value- the value(s) for this row- Throws:
SQLException- on failure
-
getResult
Description copied from interface:AggregateThis method returns the computed aggregate value. This method must preserve previously added values and must be able to reevaluate result if more values were added since its previous invocation.- Specified by:
getResultin interfaceAggregate- Returns:
- the aggregated value
- Throws:
SQLException- on failure
-