Package io.jmix.flowui.data.aggregation
Interface Aggregation<T>
- Type Parameters:
T- the type of the items to be aggregated
- All Known Implementing Classes:
AbstractAggregation,AbstractNumberAggregation,BigDecimalAggregation,BigIntegerAggregation,CountAggregation,DateAggregation,DateTimeAggregation,DoubleAggregation,LocalDateAggregation,LocalDateTimeAggregation,LocalTimeAggregation,LongAggregation,OffsetDateTimeAggregation,OffsetTimeAggregation,TimeAggregation
public interface Aggregation<T>
Defines methods for performing aggregation operations on a collection of items.
-
Method Summary
Modifier and TypeMethodDescriptionavg(Collection<T> items) Computes the average value of the elements in the provided collection.intcount(Collection<T> items) Counts the number of elements in the provided collection.Returns the class type of the result produced by this aggregation.Returns the set of aggregation types that are supported by this class.max(Collection<T> items) Determines the maximum value in the provided collection of items.min(Collection<T> items) Determines the minimum value in the provided collection of items.sum(Collection<T> items) Calculates the sum of the provided collection of items.
-
Method Details
-
sum
Calculates the sum of the provided collection of items.- Parameters:
items- the collection of items to be summed- Returns:
- the sum of the items, or
nullif the collection is empty
-
avg
Computes the average value of the elements in the provided collection.- Parameters:
items- the collection of elements to be averaged- Returns:
- the average value of the elements, or
nullif the collection is empty
-
min
Determines the minimum value in the provided collection of items.- Parameters:
items- the collection of items to evaluate for the minimum value- Returns:
- the minimum value from the collection, or
nullif the collection is empty
-
max
Determines the maximum value in the provided collection of items.- Parameters:
items- the collection of items to evaluate for the maximum value- Returns:
- the maximum value from the collection, or
nullif the collection is empty
-
count
Counts the number of elements in the provided collection.- Parameters:
items- the collection of items to be counted- Returns:
- the total number of elements in the collection
-
getResultClass
Returns the class type of the result produced by this aggregation.- Returns:
- the class representing the type of the result
-
getSupportedAggregationTypes
EnumSet<AggregationInfo.Type> getSupportedAggregationTypes()Returns the set of aggregation types that are supported by this class.- Returns:
- a set of supported aggregation types
-