public class WorldObjectFuture<T extends IWorldObject> extends Object implements Future<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
WorldObjectFuture.WorldObjectFutureException |
| Constructor and Description |
|---|
WorldObjectFuture(IWorldView worldView,
Class<T> objectClass)
Creates new instance of future that waits for first appearance of WorldObject
of given class.
|
WorldObjectFuture(IWorldView worldView,
String id,
Class<T> objectClass)
Creates new instance of future that waits for first appearance of WorldObject
of given id.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
protected void |
customObjectEncounteredHook(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 WorldObjectFuture(IWorldView worldView, Class<T> objectClass)
worldView - WorldView where the object will appearobjectClass - class of the object that will appearpublic WorldObjectFuture(IWorldView worldView, String id, Class<T> objectClass)
worldView - WorldView where the object will appearid - string id of the object that will appearobjectClass - class of the object that will appearprotected void customObjectEncounteredHook(T obj)
obj - public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface Future<T extends IWorldObject>public boolean isCancelled()
isCancelled in interface Future<T extends IWorldObject>public boolean isDone()
isDone in interface Future<T extends IWorldObject>public T get()
get in interface Future<T extends IWorldObject>InterruptedExceptionExecutionExceptionCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.