Interface Task.Collector<T,A,R>

Type Parameters:
T - the type of input elements to the reduction operation
A - the mutable accumulation type of the reduction operation (often hidden as an implementation detail)
R - the result type of the reduction operation
All Superinterfaces:
ExternalizableLite, Serializable
All Known Implementing Classes:
com.oracle.coherence.concurrent.executor.AbstractCollector, TaskCollectors.CountCollector, TaskCollectors.FirstOfCollector, TaskCollectors.LastOfCollector, TaskCollectors.ListOfCollector, TaskCollectors.SetOfCollector
Enclosing interface:
Task<T>

public static interface Task.Collector<T,A,R> extends ExternalizableLite
A mutable reduction operation that accumulates results into a mutable result container, optionally transforming the accumulated result into a final representation after all results have been processed.
See Also:
  • Method Details

    • accumulator

      BiConsumer<A,T> accumulator()
      A function that folds Task results into a mutable result container.
      Returns:
      a function that folds Task results into a mutable result container
    • finisher

      Function<A,R> finisher()
      Perform the final transformation from the intermediate accumulation type A to the final result type R.
      Returns:
      a function which transforms the intermediate result to the final result
    • finishable

      Remote.Predicate<A> finishable()
      A Remote.Predicate to determine if a result container can be finished early avoiding further accumulation of results using the container.

      Should there be no further results to accumulate, finishing the result container with the finisher() will occur regardless of the result returned by the Remote.Predicate.

      Returns:
      a Remote.Predicate
    • supplier

      Supplier<A> supplier()
      A function that creates and returns a new mutable result container.
      Returns:
      a function which returns a new mutable result container