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 Object implements AggregateFunction
This median implementation keeps all objects in memory.
  • Constructor Details

    • MedianString

      public MedianString()
  • Method Details

    • add

      public void add(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 Object getResult()
      Description copied from interface: AggregateFunction
      This 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:
      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, Types
      Returns:
      the SQL type of the result