Class TaskCollectors.FirstOfCollector<T>
java.lang.Object
com.oracle.coherence.concurrent.executor.TaskCollectors.FirstOfCollector<T>
- Type Parameters:
T- the type of result
- All Implemented Interfaces:
Task.Collector<T,,AtomicReference<T>, T> ExternalizableLite,PortableObject,Serializable
- Enclosing class:
TaskCollectors
public static class TaskCollectors.FirstOfCollector<T>
extends Object
implements Task.Collector<T,AtomicReference<T>,T>, PortableObject
A
Task.Collector to collect any (the first provided) available result.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA 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.voidRestore the contents of a user type instance by reading its state using the specified PofReader object.supplier()A function that creates and returns a new mutable result container.voidwriteExternal(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tangosol.io.ExternalizableLite
readExternal, writeExternal
-
Constructor Details
-
FirstOfCollector
public FirstOfCollector()
-
-
Method Details
-
accumulator
Description copied from interface:Task.CollectorA function that foldsTaskresults into a mutable result container.- Specified by:
accumulatorin interfaceTask.Collector<T,AtomicReference<T>, T> - Returns:
- a function that folds
Taskresults into a mutable result container
-
finisher
Description copied from interface:Task.CollectorPerform the final transformation from the intermediate accumulation type A to the final result type R.- Specified by:
finisherin interfaceTask.Collector<T,AtomicReference<T>, T> - Returns:
- a function which transforms the intermediate result to the final result
-
finishable
Description copied from interface:Task.CollectorARemote.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
Task.Collector.finisher()will occur regardless of the result returned by theRemote.Predicate.- Specified by:
finishablein interfaceTask.Collector<T,AtomicReference<T>, T> - Returns:
- a
Remote.Predicate
-
supplier
Description copied from interface:Task.CollectorA function that creates and returns a new mutable result container.- Specified by:
supplierin interfaceTask.Collector<T,AtomicReference<T>, T> - Returns:
- a function which returns a new mutable result container
-
readExternal
Description copied from interface:PortableObjectRestore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
readExternalin interfacePortableObject- Parameters:
in- the PofReader from which to read the object's state- Throws:
IOException- if an I/O error occurs
-
writeExternal
Description copied from interface:PortableObjectSave the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternalin interfacePortableObject- Parameters:
out- the PofWriter to which to write the object's state- Throws:
IOException- if an I/O error occurs
-