Package gov.nih.mipav.model.algorithms
Class ContourPlot.ParallelForEachExecutor<T>
java.lang.Object
java.util.concurrent.ForkJoinTask<Void>
java.util.concurrent.CountedCompleter<Void>
gov.nih.mipav.model.algorithms.ContourPlot.ParallelForEachExecutor<T>
- All Implemented Interfaces:
Serializable,Future<Void>
- Enclosing class:
ContourPlot
CountedCompleter class for multithreaded execution of a Consumer on a
Spliterator. Used to realise multithreaded forEach loop in
ContourPlot.ImgBase.forEach(Consumer).- Since:
- 2.0 (relocated from Img class)
- Author:
- hageldave
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateParallelForEachExecutor(ContourPlot.ParallelForEachExecutor<T> parent, Spliterator<T> spliterator, Consumer<? super T> action) ParallelForEachExecutor(Spliterator<T> spliterator, Consumer<? super T> action) Creates a new ParallelForEachExecutor that executes the specifiedConsumer(action) on the elements of the specifiedSpliterator. -
Method Summary
Methods inherited from class java.util.concurrent.CountedCompleter
addToPendingCount, compareAndSetPendingCount, complete, decrementPendingCountUnlessZero, exec, firstComplete, getCompleter, getPendingCount, getRawResult, getRoot, helpComplete, nextComplete, onCompletion, onExceptionalCompletion, propagateCompletion, quietlyCompleteRoot, setPendingCount, setRawResult, tryCompleteMethods inherited from class java.util.concurrent.ForkJoinTask
adapt, adapt, adapt, adaptInterruptible, cancel, compareAndSetForkJoinTaskTag, completeExceptionally, exceptionNow, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollSubmission, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, quietlyJoin, quietlyJoinUninterruptibly, reinitialize, resultNow, setForkJoinTaskTag, state, tryUnfork
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
spliterator
-
action
-
-
Constructor Details
-
ParallelForEachExecutor
Creates a new ParallelForEachExecutor that executes the specifiedConsumer(action) on the elements of the specifiedSpliterator. In parallel.Call
ForkJoinTask.invoke()to trigger execution.- Parameters:
spliterator- that provides the elements on which the action is to be performedaction- to be performed
-
ParallelForEachExecutor
private ParallelForEachExecutor(ContourPlot.ParallelForEachExecutor<T> parent, Spliterator<T> spliterator, Consumer<? super T> action)
-
-
Method Details
-
compute
public void compute()- Specified by:
computein classCountedCompleter<Void>
-