Interface Aggregator<E,​R>

Type Parameters:
E - type of object to collect/aggregate
R - type of resulting aggregation
All Superinterfaces:
Consumer<E>
All Known Subinterfaces:
SortingAggregator<E,​R>
All Known Implementing Classes:
Aggregate_doubleMin, Aggregate_doubleSum, AggregateApplies, AggregateArrayAdder, AggregateArrayBuilder, AggregateContains, AggregateCount, AggregateCountingAdd, AggregateCountingPut, AggregateMax, AggregateMin, AggregateOffsetLength, AggregateSearch, AvgInteger, AvgIntegerNonNull, CqlWrapperCollectorLinkingFinalizing, CqlWrapperCollectorLinkingSorting, CqlWrapperCollectorProcedure, CqlWrapperCollectorSequenceSorting, KamikazeArrayAdder, PickAggregate, SumByte, SumDouble, SumFloat, SumInteger, SumLong, SumShort, ToArrayAggregator, TypeDictionaryAppenderBuilder, XFunc.MaxInteger
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface
public interface Aggregator<E,​R>
extends Consumer<E>
Helps to aggregate multiple elements to one collected object.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Interface Description
    static interface  Aggregator.Creator<E,​R>  
  • Method Summary

    Modifier and Type Method Description
    void accept​(E element)
    Aggregate single element to the collecting object.
    default Aggregator<E,​R> reset()
    Resets the aggregation.
    default R yield()
    Builds or aggregates the added elements to one collected object.

    Methods inherited from interface java.util.function.Consumer

    andThen
  • Method Details

    • reset

      default Aggregator<E,​R> reset()
      Resets the aggregation. (e.g. removes all the aggregated elements from the collection)
      Returns:
      this
    • accept

      void accept​(E element)
      Aggregate single element to the collecting object.
      Specified by:
      accept in interface Consumer<E>
      Parameters:
      element - to aggregate
    • yield

      default R yield()
      Builds or aggregates the added elements to one collected object.
      Returns:
      the collected object