Package org.h2.test.db
Class TestFunctions.MedianString
- java.lang.Object
-
- 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
Constructors Constructor Description MedianString()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.Object value)This method is called once for each row.java.lang.ObjectgetResult()This method returns the computed aggregate value.intgetType(int[] inputType)This method must return the SQL type of the method, given the SQL type of the input data.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.h2.api.AggregateFunction
init
-
-
-
-
Method Detail
-
add
public void add(java.lang.Object value)
Description copied from interface:AggregateFunctionThis method is called once for each row. If the aggregate function is called with multiple parameters, those are passed as array.- Specified by:
addin interfaceAggregateFunction- Parameters:
value- the value(s) for this row
-
getResult
public java.lang.Object getResult()
Description copied from interface:AggregateFunctionThis 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 interfaceAggregateFunction- Returns:
- the aggregated value
-
getType
public int getType(int[] inputType)
Description copied from interface:AggregateFunctionThis 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:
getTypein interfaceAggregateFunction- Parameters:
inputType- the SQL type of the parameters,Types- Returns:
- the SQL type of the result
-
-