Class OperationAggregator<T,​K,​R>

  • All Implemented Interfaces:
    java.lang.Iterable<AggregationSet<T,​K,​R>>

    public class OperationAggregator<T,​K,​R>
    extends java.lang.Object
    implements java.lang.Iterable<AggregationSet<T,​K,​R>>
    The OperationAggregator takes a set of objects, splits them up based on keys determined by a KeyProvider, and then aggregates the results back together in the correct order, after some execution has occured.
    Parameters: T - Request type K - Key type R - Result type
    Usage:
    1. Create new aggregator with correct types.
    2. Call aggregator.put() with the input list, and a (usually anonymous) implementation of KeyProvider that returns the key for the given input.
    3. Iterate through the AggregationSet<T,K,R\> now contained in the aggregator, do something.
    4. Return aggregator.getResults()