public class WorldEventFuture<T extends IWorldEvent> extends Object implements Future<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
WorldEventFuture.WorldEventFutureException |
| Constructor and Description |
|---|
WorldEventFuture(IWorldView worldView,
Class<T> eventClass)
Creates new instance of future that waits for the event of given class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
protected void |
customEventEncounteredHook(T obj)
Utility method for custom handling of the first-encounter event.
|
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
public WorldEventFuture(IWorldView worldView, Class<T> eventClass)
worldView - WorldView where the object will appeareventClass - class of the event we're waiting forprotected void customEventEncounteredHook(T obj)
obj - public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface Future<T extends IWorldEvent>public boolean isCancelled()
isCancelled in interface Future<T extends IWorldEvent>public boolean isDone()
isDone in interface Future<T extends IWorldEvent>public T get()
get in interface Future<T extends IWorldEvent>InterruptedExceptionExecutionExceptionCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.