org.h2.test.db
Class TestFunctions.MedianString

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

public static class TestFunctions.MedianString
extends java.lang.Object
implements AggregateFunction

This median implementation keeps all objects in memory.


Constructor Summary
TestFunctions.MedianString()
           
 
Method Summary
 void add(java.lang.Object value)
          This method is called once for each row.
 java.lang.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(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.MedianString

public TestFunctions.MedianString()
Method Detail

add

public void add(java.lang.Object value)
Description copied from interface: AggregateFunction
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 AggregateFunction
Parameters:
value - the value(s) for this row

getResult

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

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

getType

public int getType(int[] inputType)
Description copied from interface: AggregateFunction
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.

Specified by:
getType in interface AggregateFunction
Parameters:
inputType - the SQL type of the parameters
Returns:
the SQL type of the result

init

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

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