Class Aggregate1

  • All Implemented Interfaces:
    Aggregate

    public class Aggregate1
    extends java.lang.Object
    implements Aggregate
    An aggregate function for tests.
    • Constructor Summary

      Constructors 
      Constructor Description
      Aggregate1()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Aggregate1

        public Aggregate1()
    • Method Detail

      • 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
      • add

        public void add​(java.lang.Object value)
                 throws java.sql.SQLException
        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
        Throws:
        java.sql.SQLException - on failure
      • getResult

        public java.lang.Object getResult()
                                   throws java.sql.SQLException
        Description copied from interface: Aggregate
        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 Aggregate
        Returns:
        the aggregated value
        Throws:
        java.sql.SQLException - on failure