T - the result typepublic abstract class LazyFuture<T>
extends java.lang.Object
implements java.util.concurrent.Future<T>
| Constructor and Description |
|---|
LazyFuture() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
reset()
Reset this future to the initial state.
|
protected abstract T |
run()
Run computation and produce the result.
|
public boolean reset()
false if it was already in initial stateprotected abstract T run() throws java.lang.Exception
java.lang.Exceptionpublic boolean cancel(boolean mayInterruptIfRunning)
cancel in interface java.util.concurrent.Future<T>public T get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Future<T>java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic T get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Future<T>java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic boolean isCancelled()
isCancelled in interface java.util.concurrent.Future<T>public boolean isDone()
isDone in interface java.util.concurrent.Future<T>