7 |
|
package jsr166y; |
8 |
|
|
9 |
|
import java.util.concurrent.*; |
10 |
– |
|
10 |
|
import java.io.Serializable; |
11 |
|
import java.util.Collection; |
12 |
|
import java.util.Collections; |
642 |
|
} |
643 |
|
|
644 |
|
/** |
645 |
< |
* @throws CancellationException {@inheritDoc} |
645 |
> |
* Waits if necessary for the computation to complete, and then |
646 |
> |
* retrieves its result. |
647 |
> |
* |
648 |
> |
* @return the computed result |
649 |
> |
* @throws CancellationException if the computation was cancelled |
650 |
> |
* @throws ExecutionException if the computation threw an |
651 |
> |
* exception |
652 |
> |
* @throws InterruptedException if the current thread is not a |
653 |
> |
* member of a ForkJoinPool and was interrupted while waiting |
654 |
|
*/ |
655 |
|
public final V get() throws InterruptedException, ExecutionException { |
656 |
|
int s; |
680 |
|
} |
681 |
|
|
682 |
|
/** |
683 |
< |
* @throws CancellationException {@inheritDoc} |
683 |
> |
* Waits if necessary for at most the given time for the computation |
684 |
> |
* to complete, and then retrieves its result, if available. |
685 |
> |
* |
686 |
> |
* @param timeout the maximum time to wait |
687 |
> |
* @param unit the time unit of the timeout argument |
688 |
> |
* @return the computed result |
689 |
> |
* @throws CancellationException if the computation was cancelled |
690 |
> |
* @throws ExecutionException if the computation threw an |
691 |
> |
* exception |
692 |
> |
* @throws InterruptedException if the current thread is not a |
693 |
> |
* member of a ForkJoinPool and was interrupted while waiting |
694 |
> |
* @throws TimeoutException if the wait timed out |
695 |
|
*/ |
696 |
|
public final V get(long timeout, TimeUnit unit) |
697 |
|
throws InterruptedException, ExecutionException, TimeoutException { |