public class PriorityFuture<T> extends Object implements RunnableFuture<T>
| Modifier and Type | Field and Description |
|---|---|
static Comparator<Runnable> |
COMP |
| Constructor and Description |
|---|
PriorityFuture(RunnableFuture<T> other,
int priority) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
int |
getPriority() |
boolean |
isCancelled() |
boolean |
isDone() |
void |
run() |
public static Comparator<Runnable> COMP
public PriorityFuture(RunnableFuture<T> other, int priority)
public int getPriority()
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<T>public T get() throws InterruptedException, ExecutionException
get in interface Future<T>InterruptedExceptionExecutionExceptionpublic T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<T>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic void run()
run in interface Runnablerun in interface RunnableFuture<T>Copyright © 2018. All rights reserved.