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 foldsTask
results into a mutable result container.ARemote.Predicate
to 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.void
Restore 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.void
writeExternal
(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, wait
Methods inherited from interface com.tangosol.io.ExternalizableLite
readExternal, writeExternal
-
Constructor Details
-
FirstOfCollector
public FirstOfCollector()
-
-
Method Details
-
accumulator
Description copied from interface:Task.Collector
A function that foldsTask
results into a mutable result container.- Specified by:
accumulator
in interfaceTask.Collector<T,
AtomicReference<T>, T> - Returns:
- a function that folds
Task
results into a mutable result container
-
finisher
Description copied from interface:Task.Collector
Perform the final transformation from the intermediate accumulation type A to the final result type R.- Specified by:
finisher
in interfaceTask.Collector<T,
AtomicReference<T>, T> - Returns:
- a function which transforms the intermediate result to the final result
-
finishable
Description copied from interface:Task.Collector
ARemote.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
Task.Collector.finisher()
will occur regardless of the result returned by theRemote.Predicate
.- Specified by:
finishable
in interfaceTask.Collector<T,
AtomicReference<T>, T> - Returns:
- a
Remote.Predicate
-
supplier
Description copied from interface:Task.Collector
A function that creates and returns a new mutable result container.- Specified by:
supplier
in interfaceTask.Collector<T,
AtomicReference<T>, T> - Returns:
- a function which returns a new mutable result container
-
readExternal
Description copied from interface:PortableObject
Restore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
readExternal
in 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:PortableObject
Save the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternal
in interfacePortableObject
- Parameters:
out
- the PofWriter to which to write the object's state- Throws:
IOException
- if an I/O error occurs
-