org.h2.test.db
Class TestFunctions.MedianStringType

java.lang.Object
  extended by org.h2.test.db.TestFunctions.MedianStringType
All Implemented Interfaces:
Aggregate
Enclosing class:
TestFunctions

public static class TestFunctions.MedianStringType
extends java.lang.Object
implements Aggregate

This median implementation keeps all objects in memory.


Constructor Summary
TestFunctions.MedianStringType()
           
 
Method Summary
 void add(java.lang.Object value)
          This method is called once for each row.
 int getInternalType(int[] inputTypes)
          This method must return the H2 data type, Value, of the aggregate function, given the H2 data type of the input data.
 java.lang.Object getResult()
          This method returns the computed aggregate value.
 void init(java.sql.Connection conn)
          This method is called when the aggregate function is used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestFunctions.MedianStringType

public TestFunctions.MedianStringType()
Method Detail

add

public void add(java.lang.Object value)
Description copied from interface: Aggregate
This method is called once for each row. If the aggregate function is called with multiple parameters, those are passed as array.

Specified by:
add in interface Aggregate
Parameters:
value - the value(s) for this row

getResult

public java.lang.Object getResult()
Description copied from interface: Aggregate
This method returns the computed aggregate value.

Specified by:
getResult in interface Aggregate
Returns:
the aggregated value

getInternalType

public int getInternalType(int[] inputTypes)
                    throws java.sql.SQLException
Description copied from interface: Aggregate
This 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:
getInternalType in interface Aggregate
Parameters:
inputTypes - the H2 data type of the parameters,
Returns:
the H2 data type of the result
Throws:
java.sql.SQLException - if the number/type of parameters passed is incorrect

init

public void init(java.sql.Connection conn)
Description copied from interface: Aggregate
This method is called when the aggregate function is used. A new object is created for each invocation.

Specified by:
init in interface Aggregate
Parameters:
conn - a connection to the database