Interface Context<C extends Context<C>>

  • All Known Implementing Classes:
    MinMaxContext, ProductContext, SumCountContext, VarianceContext

    public interface Context<C extends Context<C>>
    The context to hold intermediate result of an aggregation. For example, to calculate arithmetic average, we need to accumulate SUM and COUNT. It is provable that if an aggregation over a collection is order independent and its computation can be carried out via a context data type with a binary operator, then the context can also be merged from contexts over a partition of the original collection.
    Author:
    simonpai
    • Method Detail

      • add

        void add​(Object item)
        Add an item into the aggregation.
      • merge

        void merge​(C ctx)
        Merge from another context of the same type.