Package gov.nih.mipav.model.algorithms
Class ContourPlot.ParallelForEachExecutor<T>
- java.lang.Object
-
- java.util.concurrent.ForkJoinTask<T>
-
- java.util.concurrent.CountedCompleter<java.lang.Void>
-
- gov.nih.mipav.model.algorithms.ContourPlot.ParallelForEachExecutor<T>
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.concurrent.Future<java.lang.Void>
- Enclosing class:
- ContourPlot
public final class ContourPlot.ParallelForEachExecutor<T> extends java.util.concurrent.CountedCompleter<java.lang.Void>
CountedCompleter class for multithreaded execution of a Consumer on a Spliterator. Used to realise multithreaded forEach loop inContourPlot.ImgBase.forEach(Consumer)
.- Since:
- 2.0 (relocated from Img class)
- Author:
- hageldave
- See Also:
ContourPlot.ImgBase.forEach(boolean parallel, Consumer action)
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Consumer<? super T>
action
private static long
serialVersionUID
private java.util.Spliterator<T>
spliterator
-
Constructor Summary
Constructors Modifier Constructor Description private
ParallelForEachExecutor(ContourPlot.ParallelForEachExecutor<T> parent, java.util.Spliterator<T> spliterator, java.util.function.Consumer<? super T> action)
ParallelForEachExecutor(java.util.Spliterator<T> spliterator, java.util.function.Consumer<? super T> action)
Creates a new ParallelForEachExecutor that executes the specifiedConsumer
(action) on the elements of the specifiedSpliterator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
compute()
-
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, tryComplete
-
Methods inherited from class java.util.concurrent.ForkJoinTask
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, completeExceptionally, 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, reinitialize, setForkJoinTaskTag, tryUnfork
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
spliterator
private final java.util.Spliterator<T> spliterator
-
action
private final java.util.function.Consumer<? super T> action
-
-
Constructor Detail
-
ParallelForEachExecutor
public ParallelForEachExecutor(java.util.Spliterator<T> spliterator, java.util.function.Consumer<? super T> action)
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, java.util.Spliterator<T> spliterator, java.util.function.Consumer<? super T> action)
-
-