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

pack-priv final Class AggregateDataDistinctWithCounts

extends AggregateData
Class Inheritance
Imports
java.util.TreeMap, org.h2.engine.SessionLocal, org.h2.value.Value, .ValueNull

Data stored while calculating an aggregate that needs distinct values with their counts.

Field Summary

Modifier and TypeField and Description
private final boolean
private final int
private TreeMap<Value, LongDataCounter>

Constructor Summary

AccessConstructor and Description
pack-priv
AggregateDataDistinctWithCounts(boolean
whether NULL values should be ignored
ignoreNulls
,
int
maximum count of distinct values to collect
maxDistinctCount
)

Creates new instance of data for aggregate that needs distinct values with their counts.

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
getValue(SessionLocal
the session
session
)

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

Get the aggregate result.

pack-priv TreeMap<Value, LongDataCounter>

Returns:

map with values and their counts
getValues
()

Returns map with values and their counts.

Field Detail

ignoreNullsback to summary
private final boolean ignoreNulls
maxDistinctCountback to summary
private final int maxDistinctCount
valuesback to summary
private TreeMap<Value, LongDataCounter> values

Constructor Detail

AggregateDataDistinctWithCountsback to summary
pack-priv AggregateDataDistinctWithCounts(boolean ignoreNulls, int maxDistinctCount)

Creates new instance of data for aggregate that needs distinct values with their counts.

Parameters
ignoreNulls:boolean

whether NULL values should be ignored

maxDistinctCount:int

maximum count of distinct values to collect

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
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
getValuesback to summary
pack-priv TreeMap<Value, LongDataCounter> getValues()

Returns map with values and their counts.

Returns:TreeMap<Value, LongDataCounter>

map with values and their counts