Package org.h2.expression.aggregate
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 enum
NULL values collection mode. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final AggregateDataCollecting.NullCollectionMode
private final boolean
private 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) void
add
(SessionLocal session, Value v) Add a value to this aggregate.(package private) Value[]
getArray()
Returns array with values ornull
.(package private) int
getCount()
Returns the count of values.(package private) Value
Returns value of a shared argument.(package private) Value
getValue
(SessionLocal session) Get the aggregate result.private boolean
iterator()
(package private) void
setSharedArgument
(Value shared) Sets value of a shared argument.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.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:AggregateData
Add a value to this aggregate.- Specified by:
add
in classAggregateData
- Parameters:
session
- the sessionv
- the value
-
isNull
-
getValue
Description copied from class:AggregateData
Get the aggregate result.- Specified by:
getValue
in classAggregateData
- 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 ornull
.- Returns:
- array with values or
null
-
iterator
-