Top Description Inners Fields Constructors Methods
org.h2.expression.aggregate

pack-priv final Class AggregateDataCollecting

extends AggregateData
implements Iterable<Value>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Imports
java.util.ArrayList, .Collection, .Collections, .Comparator, .Iterator, .TreeSet, org.h2.api.ErrorCode, org.h2.engine.SessionLocal, org.h2.message.DbException, org.h2.value.Value, .ValueNull, .ValueRow

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 and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum
AggregateDataCollecting.NullCollectionMode

NULL values collection mode.

Field Summary

Modifier and TypeField and Description
private final boolean
private final AggregateDataCollecting.NullCollectionMode
private final boolean
private Value
pack-priv Collection<Value>

Constructor Summary

AccessConstructor and Description
pack-priv
AggregateDataCollecting(boolean
if distinct is used
distinct
,
boolean
if aggregate is an ordered aggregate with ORDER BY clause
orderedWithOrder
,
AggregateDataCollecting.NullCollectionMode
NULL values collection mode
nullCollectionMode
)

Creates new instance of data for collecting aggregates.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
add(SessionLocal
the session
session
,
Value
the value
v
)

Implements abstract org.h2.expression.aggregate.AggregateData.add.

Add a value to this aggregate.

pack-priv Value[]

Returns:

array with values or null
getArray
()

Returns array with values or null.

pack-priv int

Returns:

the count of values
getCount
()

Returns the count of values.

pack-priv Value

Returns:

value of a shared argument
getSharedArgument
()

Returns value of a shared argument.

pack-priv Value
getValue(SessionLocal
the session
session
)

Implements abstract org.h2.expression.aggregate.AggregateData.getValue.

Get the aggregate result.

private boolean
public Iterator<Value>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

pack-priv void
setSharedArgument(Value
the shared value
shared
)

Sets value of a shared argument.

Field Detail

distinctback to summary
private final boolean distinct
nullCollectionModeback to summary
private final AggregateDataCollecting.NullCollectionMode nullCollectionMode
orderedWithOrderback to summary
private final boolean orderedWithOrder
sharedback to summary
private Value shared
valuesback to summary
pack-priv Collection<Value> values

Constructor Detail

AggregateDataCollectingback to summary
pack-priv AggregateDataCollecting(boolean distinct, boolean orderedWithOrder, AggregateDataCollecting.NullCollectionMode nullCollectionMode)

Creates new instance of data for collecting aggregates.

Parameters
distinct:boolean

if distinct is used

orderedWithOrder:boolean

if aggregate is an ordered aggregate with ORDER BY clause

nullCollectionMode:AggregateDataCollecting.NullCollectionMode

NULL values collection mode

Method Detail

addback to summary
pack-priv void add(SessionLocal session, Value v)

Implements abstract org.h2.expression.aggregate.AggregateData.add.

Doc from org.h2.expression.aggregate.AggregateData.add.

Add a value to this aggregate.

Parameters
session:SessionLocal

the session

v:Value

the value

Annotations
@Override
getArrayback to summary
pack-priv Value[] getArray()

Returns array with values or null.

Returns:Value[]

array with values or null

getCountback to summary
pack-priv int getCount()

Returns the count of values.

Returns:int

the count of values

getSharedArgumentback to summary
pack-priv Value getSharedArgument()

Returns value of a shared argument.

Returns:Value

value of a shared argument

getValueback to summary
pack-priv Value getValue(SessionLocal session)

Implements abstract org.h2.expression.aggregate.AggregateData.getValue.

Doc from org.h2.expression.aggregate.AggregateData.getValue.

Get the aggregate result.

Parameters
session:SessionLocal

the session

Returns:Value

the value

Annotations
@Override
isNullback to summary
private boolean isNull(Value v)
iteratorback to summary
public Iterator<Value> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<Value>

an Iterator.

Annotations
@Override
setSharedArgumentback to summary
pack-priv void setSharedArgument(Value shared)

Sets value of a shared argument.

Parameters
shared:Value

the shared value

org.h2.expression.aggregate back to summary

pack-priv final Enum AggregateDataCollecting.NullCollectionMode

extends Enum<AggregateDataCollecting.NullCollectionMode>
Class Inheritance

NULL values collection mode.

Field Summary

Modifier and TypeField and Description
public static final AggregateDataCollecting.NullCollectionMode
EXCLUDED

Rows with NULL values are processed causing the result to be not NULL, but NULL values aren't collected.

public static final AggregateDataCollecting.NullCollectionMode
IGNORED

Rows with NULL value are completely ignored.

public static final AggregateDataCollecting.NullCollectionMode
USED_OR_IMPOSSIBLE

Rows with NULL values are aggregated just like rows with any other values, should also be used when NULL values aren't passed to AggregateDataCollecting.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static AggregateDataCollecting.NullCollectionMode
public static AggregateDataCollecting.NullCollectionMode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

EXCLUDEDback to summary
public static final AggregateDataCollecting.NullCollectionMode EXCLUDED

Rows with NULL values are processed causing the result to be not NULL, but NULL values aren't collected.

IGNOREDback to summary
public static final AggregateDataCollecting.NullCollectionMode IGNORED

Rows with NULL value are completely ignored.

USED_OR_IMPOSSIBLEback to summary
public static final AggregateDataCollecting.NullCollectionMode USED_OR_IMPOSSIBLE

Rows with NULL values are aggregated just like rows with any other values, should also be used when NULL values aren't passed to AggregateDataCollecting.

Constructor Detail

NullCollectionModeback to summary
private NullCollectionMode()

Method Detail

valueOfback to summary
public static AggregateDataCollecting.NullCollectionMode valueOf(String name)
valuesback to summary
public static AggregateDataCollecting.NullCollectionMode[] values()