All Implemented Interfaces:
AggregateAttributeLoader<Number>, AttributeLoader<Number>, MultiRowAttributeLoader<Number>, ValueReducer<Number>, RowAttributeLoader<Number>

public class NumberSumLoader extends SingleDependencyReducingAggregateLoader<Number>
  • Constructor Details

  • Method Details

    • reduce

      public Number reduce(@NotNull List<Number> list)
      Description copied from interface: ValueReducer
      Reduces the list of values to one value. Describes 'flat' reduction of elements without hierarchy. Called reducing direct children values or from merge methods if not overridden. Can be called from convert method
      Parameters:
      list - list of values, every item can be null
      Returns:
      value after reduction, null means undefined
    • merge

      public Number merge(@NotNull Supplier<Number> self, @NotNull Supplier<Number> reduced)
      Description copied from interface: ValueReducer
      Calculates reduction of tree node where self is value of the current row, and reduced is result of flat reduction. Value modifications can be done here if one wants to build reduction that computes value based on depth in the structure. Called from strict subtree reduction strategy or from other merge method if not optimized.
    • merge

      public Number merge(Supplier<Number> self, List<Number> list)
      Description copied from interface: ValueReducer
      Calculates reduction of tree node where self is value of the current row and list represents values passed from children (it may be or be not values of children rows depending on strategy type). Value modifications can be done here if one wants to build reduction that computes value based on depth in the structure. Called from full subtree reduction strategy, that is default and the most frequently used strategy for most reducing aggregates (it makes this method the most probable target for optimization).