| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cancelled |
protected boolean |
done |
protected Throwable |
exception |
protected T |
result |
| Constructor and Description |
|---|
ResultFuture(AsyncCallback<T> handler) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
setException(Throwable ex) |
void |
setResult(T res) |
protected T result
protected Throwable exception
protected volatile boolean done
protected boolean cancelled
public ResultFuture(AsyncCallback<T> handler)
public void setResult(T res)
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 setException(Throwable ex)
Copyright © 2024. All rights reserved.