- All Implemented Interfaces:
Serializable,Future<Void>
A fork-join task that processes a range of integers from
lo to hi (exclusive)
in chunks of up to chunkSize.- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Constructor Summary
ConstructorsConstructorDescriptionTileTask(@NonNull TileTask.Tile tile, int chunkSize, @NonNull Consumer<TileTask.Tile> tileConsumer, @NonNull CompletableFuture<Void> future) -
Method Summary
Modifier and TypeMethodDescriptionvoidcompute()static voidforEach(int x, int y, int width, int height, int chunkSize, Consumer<TileTask.Tile> action) static CompletableFuture<Void> fork(int x, int y, int width, int height, int chunkSize, Consumer<TileTask.Tile> action) voidonCompletion(CountedCompleter<?> caller) booleanonExceptionalCompletion(Throwable ex, CountedCompleter<?> caller) Methods inherited from class java.util.concurrent.CountedCompleter
addToPendingCount, compareAndSetPendingCount, complete, decrementPendingCountUnlessZero, exec, firstComplete, getCompleter, getPendingCount, getRawResult, getRoot, helpComplete, nextComplete, 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
-
Constructor Details
-
TileTask
public TileTask(@NonNull TileTask.Tile tile, int chunkSize, @NonNull Consumer<TileTask.Tile> tileConsumer, @NonNull CompletableFuture<Void> future)
-
-
Method Details
-
forEach
public static void forEach(int x, int y, int width, int height, int chunkSize, Consumer<TileTask.Tile> action) -
fork
public static CompletableFuture<Void> fork(int x, int y, int width, int height, int chunkSize, Consumer<TileTask.Tile> action) -
compute
public void compute()- Specified by:
computein classCountedCompleter<Void>
-
onCompletion
- Overrides:
onCompletionin classCountedCompleter<Void>
-
onExceptionalCompletion
- Overrides:
onExceptionalCompletionin classCountedCompleter<Void>
-