Interface Task.Collector<T,A,R>
- Type Parameters:
T- the type of input elements to the reduction operationA- 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
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 Summary
Modifier and TypeMethodDescriptionBiConsumer<A, T> A function that foldsTaskresults into a mutable result container.ARemote.Predicateto determine if a result container can be finished early avoiding further accumulation of results using the container.finisher()Perform the final transformation from the intermediate accumulation type A to the final result type R.supplier()A function that creates and returns a new mutable result container.Methods inherited from interface com.tangosol.io.ExternalizableLite
readExternal, writeExternal
-
Method Details
-
accumulator
BiConsumer<A,T> accumulator()A function that foldsTaskresults into a mutable result container.- Returns:
- a function that folds
Taskresults into a mutable result container
-
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()ARemote.Predicateto 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 theRemote.Predicate.- Returns:
- a
Remote.Predicate
-
supplier
A function that creates and returns a new mutable result container.- Returns:
- a function which returns a new mutable result container
-