Class AggregateDataCollecting
java.lang.Object
org.h2.expression.aggregate.AggregateData
org.h2.expression.aggregate.AggregateDataCollecting
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumNULL values collection mode. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final AggregateDataCollecting.NullCollectionModeprivate final booleanprivate Value(package private) Collection<Value> -
Constructor Summary
ConstructorsConstructorDescriptionAggregateDataCollecting(boolean distinct, boolean orderedWithOrder, AggregateDataCollecting.NullCollectionMode nullCollectionMode) Creates new instance of data for collecting aggregates. -
Method Summary
Modifier and TypeMethodDescription(package private) voidadd(SessionLocal session, Value v) Add a value to this aggregate.(package private) Value[]getArray()Returns array with values ornull.(package private) intgetCount()Returns the count of values.(package private) ValueReturns value of a shared argument.(package private) ValuegetValue(SessionLocal session) Get the aggregate result.private booleaniterator()(package private) voidsetSharedArgument(Value shared) Sets value of a shared argument.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
distinct
private final boolean distinct -
orderedWithOrder
private final boolean orderedWithOrder -
nullCollectionMode
-
values
Collection<Value> values
-
-
Constructor Details
-
AggregateDataCollecting
AggregateDataCollecting(boolean distinct, boolean orderedWithOrder, AggregateDataCollecting.NullCollectionMode nullCollectionMode) Creates new instance of data for collecting aggregates.- Parameters:
distinct- if distinct is usedorderedWithOrder- if aggregate is an ordered aggregate with ORDER BY clausenullCollectionMode- NULL values collection mode
-
-
Method Details
-
add
Description copied from class:AggregateDataAdd a value to this aggregate.- Specified by:
addin classAggregateData- Parameters:
session- the sessionv- the value
-
isNull
-
getValue
Description copied from class:AggregateDataGet the aggregate result.- Specified by:
getValuein classAggregateData- Parameters:
session- the session- Returns:
- the value
-
getCount
int getCount()Returns the count of values.- Returns:
- the count of values
-
getArray
-
iterator
-