Class AggregateDataCollecting

java.lang.Object
org.h2.expression.aggregate.AggregateData
org.h2.expression.aggregate.AggregateDataCollecting
All Implemented Interfaces:
Iterable<Value>

final class AggregateDataCollecting extends AggregateData implements Iterable<Value>
Data stored while calculating an aggregate that needs collecting of all values or a distinct aggregate.

NULL values are not collected. getValue(SessionLocal) method returns null. Use getArray() for instances of this class instead.

  • Field Details

  • Constructor Details

    • AggregateDataCollecting

      AggregateDataCollecting(boolean distinct, boolean orderedWithOrder, AggregateDataCollecting.NullCollectionMode nullCollectionMode)
      Creates new instance of data for collecting aggregates.
      Parameters:
      distinct - if distinct is used
      orderedWithOrder - if aggregate is an ordered aggregate with ORDER BY clause
      nullCollectionMode - NULL values collection mode
  • Method Details

    • add

      void add(SessionLocal session, Value v)
      Description copied from class: AggregateData
      Add a value to this aggregate.
      Specified by:
      add in class AggregateData
      Parameters:
      session - the session
      v - the value
    • isNull

      private boolean isNull(Value v)
    • getValue

      Value getValue(SessionLocal session)
      Description copied from class: AggregateData
      Get the aggregate result.
      Specified by:
      getValue in class AggregateData
      Parameters:
      session - the session
      Returns:
      the value
    • getCount

      int getCount()
      Returns the count of values.
      Returns:
      the count of values
    • getArray

      Value[] getArray()
      Returns array with values or null.
      Returns:
      array with values or null
    • iterator

      public Iterator<Value> iterator()
      Specified by:
      iterator in interface Iterable<Value>
    • setSharedArgument

      void setSharedArgument(Value shared)
      Sets value of a shared argument.
      Parameters:
      shared - the shared value
    • getSharedArgument

      Value getSharedArgument()
      Returns value of a shared argument.
      Returns:
      value of a shared argument