Class SearchTask
java.lang.Object
java.util.concurrent.ForkJoinTask<Integer>
java.util.concurrent.CountedCompleter<Integer>
ch.hslu.exercises.sw11.ex1.n41.array.search.SearchTask
- All Implemented Interfaces:
Serializable
,Future<Integer>
Codebeispiel zu CountedCompleter für die Suche eines Elementes in einem
int-Array.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Constructor Summary
-
Method Summary
Methods inherited from class java.util.concurrent.CountedCompleter
addToPendingCount, compareAndSetPendingCount, complete, decrementPendingCountUnlessZero, exec, firstComplete, getCompleter, getPendingCount, getRoot, helpComplete, nextComplete, onCompletion, onExceptionalCompletion, propagateCompletion, quietlyCompleteRoot, setPendingCount, setRawResult, tryComplete
Methods 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
-
SearchTask
public SearchTask(int key, int[] array) Erzeugt einen Array-Such Task.- Parameters:
key
- zu findendes Element.array
- Interger-Array.
-
-
Method Details
-
getRawResult
- Overrides:
getRawResult
in classCountedCompleter<Integer>
-
compute
public void compute()- Specified by:
compute
in classCountedCompleter<Integer>
-