Package org.h2.expression.aggregate
Class AggregateDataDistinctWithCounts
java.lang.Object
org.h2.expression.aggregate.AggregateData
org.h2.expression.aggregate.AggregateDataDistinctWithCounts
Data stored while calculating an aggregate that needs distinct values with
their counts.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final int
private TreeMap
<Value, LongDataCounter> -
Constructor Summary
ConstructorsConstructorDescriptionAggregateDataDistinctWithCounts
(boolean ignoreNulls, int maxDistinctCount) Creates new instance of data for aggregate that needs distinct values with their counts. -
Method Summary
Modifier and TypeMethodDescription(package private) void
add
(SessionLocal session, Value v) Add a value to this aggregate.(package private) Value
getValue
(SessionLocal session) Get the aggregate result.(package private) TreeMap
<Value, LongDataCounter> Returns map with values and their counts.
-
Field Details
-
ignoreNulls
private final boolean ignoreNulls -
maxDistinctCount
private final int maxDistinctCount -
values
-
-
Constructor Details
-
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 Details
-
add
Description copied from class:AggregateData
Add a value to this aggregate.- Specified by:
add
in classAggregateData
- Parameters:
session
- the sessionv
- the value
-
getValue
Description copied from class:AggregateData
Get the aggregate result.- Specified by:
getValue
in classAggregateData
- Parameters:
session
- the session- Returns:
- the value
-
getValues
TreeMap<Value,LongDataCounter> getValues()Returns map with values and their counts.- Returns:
- map with values and their counts
-