Package org.h2.expression.aggregate
Class AggregateDataDistinctWithCounts
- java.lang.Object
-
- org.h2.expression.aggregate.AggregateData
-
- org.h2.expression.aggregate.AggregateDataDistinctWithCounts
-
final class AggregateDataDistinctWithCounts extends AggregateData
Data stored while calculating an aggregate that needs distinct values with their counts.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanignoreNullsprivate intmaxDistinctCountprivate java.util.TreeMap<Value,LongDataCounter>values
-
Constructor Summary
Constructors Constructor Description AggregateDataDistinctWithCounts(boolean ignoreNulls, int maxDistinctCount)Creates new instance of data for aggregate that needs distinct values with their counts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidadd(SessionLocal session, Value v)Add a value to this aggregate.(package private) ValuegetValue(SessionLocal session)Get the aggregate result.(package private) java.util.TreeMap<Value,LongDataCounter>getValues()Returns map with values and their counts.
-
-
-
Field Detail
-
ignoreNulls
private final boolean ignoreNulls
-
maxDistinctCount
private final int maxDistinctCount
-
values
private java.util.TreeMap<Value,LongDataCounter> values
-
-
Constructor Detail
-
AggregateDataDistinctWithCounts
AggregateDataDistinctWithCounts(boolean ignoreNulls, int maxDistinctCount)Creates new instance of data for aggregate that needs distinct values with their counts.- Parameters:
ignoreNulls- whether NULL values should be ignoredmaxDistinctCount- maximum count of distinct values to collect
-
-
Method Detail
-
add
void add(SessionLocal session, Value v)
Description copied from class:AggregateDataAdd a value to this aggregate.- Specified by:
addin classAggregateData- Parameters:
session- the sessionv- the value
-
getValue
Value getValue(SessionLocal session)
Description copied from class:AggregateDataGet the aggregate result.- Specified by:
getValuein classAggregateData- Parameters:
session- the session- Returns:
- the value
-
getValues
java.util.TreeMap<Value,LongDataCounter> getValues()
Returns map with values and their counts.- Returns:
- map with values and their counts
-
-