|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.structure.element.FutureSimple<V>
V - public class FutureSimple<V>
Simple Future implementation using a CountDownLatch which unlocks when the value is set.
| Constructor Summary | |
|---|---|
FutureSimple()
|
|
| Method Summary | |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
|
V |
get()
|
V |
get(long timeout,
TimeUnit unit)
|
boolean |
getShouldCancel()
Returns true if the Future.cancel(boolean) method has been called at least once |
boolean |
isCancelled()
|
boolean |
isDone()
|
void |
setIsCancelled(boolean isCancelled)
Sets the value for the Future.isCancelled() |
void |
setValue(V value)
Sets the value to be returned by Future.get(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FutureSimple()
Future,
FutureSimple| Method Detail |
|---|
public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface Future<V>public boolean isCancelled()
isCancelled in interface Future<V>public boolean isDone()
isDone in interface Future<V>
public V get()
throws InterruptedException,
ExecutionException
get in interface Future<V>InterruptedException
ExecutionException
public V get(long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
get in interface Future<V>InterruptedException
ExecutionException
TimeoutExceptionpublic void setValue(V value)
Future.get(). After setting any value the Future.isDone() will return true.
value - public boolean getShouldCancel()
Future.cancel(boolean) method has been called at least once
public void setIsCancelled(boolean isCancelled)
Future.isCancelled()
isCancelled -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||