Class AbstractNumberAggregation<T extends Number>

java.lang.Object
io.jmix.flowui.data.aggregation.impl.AbstractAggregation<T>
io.jmix.flowui.data.aggregation.impl.AbstractNumberAggregation<T>
Type Parameters:
T - the type of number being aggregated
All Implemented Interfaces:
Aggregation<T>
Direct Known Subclasses:
BigDecimalAggregation, BigIntegerAggregation, DoubleAggregation, LongAggregation

public abstract class AbstractNumberAggregation<T extends Number> extends AbstractAggregation<T>
Abstract base class for performing aggregation operations on collections of numerical data.
  • Constructor Details

    • AbstractNumberAggregation

      protected AbstractNumberAggregation(Class<T> clazz)
  • Method Details

    • sum

      public T sum(Collection<T> items)
      Description copied from interface: Aggregation
      Calculates the sum of the provided collection of items.
      Specified by:
      sum in interface Aggregation<T extends Number>
      Overrides:
      sum in class AbstractAggregation<T extends Number>
      Parameters:
      items - the collection of items to be summed
      Returns:
      the sum of the items, or null if the collection is empty
    • avg

      public T avg(Collection<T> items)
      Description copied from interface: Aggregation
      Computes the average value of the elements in the provided collection.
      Specified by:
      avg in interface Aggregation<T extends Number>
      Overrides:
      avg in class AbstractAggregation<T extends Number>
      Parameters:
      items - the collection of elements to be averaged
      Returns:
      the average value of the elements, or null if the collection is empty
    • min

      @Nullable public T min(Collection<T> items)
      Description copied from interface: Aggregation
      Determines the minimum value in the provided collection of items.
      Specified by:
      min in interface Aggregation<T extends Number>
      Overrides:
      min in class AbstractAggregation<T extends Number>
      Parameters:
      items - the collection of items to evaluate for the minimum value
      Returns:
      the minimum value from the collection, or null if the collection is empty
    • max

      public T max(Collection<T> items)
      Description copied from interface: Aggregation
      Determines the maximum value in the provided collection of items.
      Specified by:
      max in interface Aggregation<T extends Number>
      Overrides:
      max in class AbstractAggregation<T extends Number>
      Parameters:
      items - the collection of items to evaluate for the maximum value
      Returns:
      the maximum value from the collection, or null if the collection is empty
    • getSupportedAggregationTypes

      public EnumSet<AggregationInfo.Type> getSupportedAggregationTypes()
      Description copied from interface: Aggregation
      Returns the set of aggregation types that are supported by this class.
      Specified by:
      getSupportedAggregationTypes in interface Aggregation<T extends Number>
      Overrides:
      getSupportedAggregationTypes in class AbstractAggregation<T extends Number>
      Returns:
      a set of supported aggregation types
    • convert

      @Nullable protected abstract T convert(@Nullable Double result)