PATH_ELEMENT - public class PrecomputedPathFuture<PATH_ELEMENT> extends Object implements IPathFuture<PATH_ELEMENT>
IPathFuture that contains pre-set result, i.e., you do not need the future, you just want to pass down
some value...| Constructor and Description |
|---|
PrecomputedPathFuture(PATH_ELEMENT from,
PATH_ELEMENT to,
List<PATH_ELEMENT> path) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFutureListener(cz.cuni.amis.utils.future.IFutureListener<List<PATH_ELEMENT>> listener)
Adds a listener on a future status (using strong reference).
|
boolean |
cancel(boolean mayInterruptIfRunning) |
List<PATH_ELEMENT> |
get()
First, see
Future.get(). |
List<PATH_ELEMENT> |
get(long timeout,
TimeUnit unit)
Returns a path from
IPathFuture.getPathFrom() to IPathFuture.getPathTo(). |
PATH_ELEMENT |
getPathFrom()
Where does the path start.
|
PATH_ELEMENT |
getPathTo()
Where does the path end.
|
cz.cuni.amis.utils.future.FutureStatus |
getStatus()
Current status of the path computation.
|
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
isListening(cz.cuni.amis.utils.future.IFutureListener<List<PATH_ELEMENT>> listener)
Whether some listener is listening on the future.
|
void |
removeFutureListener(cz.cuni.amis.utils.future.IFutureListener<List<PATH_ELEMENT>> listener)
Removes a listener from the future.
|
public PrecomputedPathFuture(PATH_ELEMENT from, PATH_ELEMENT to, List<PATH_ELEMENT> path)
public PATH_ELEMENT getPathFrom()
IPathFuturegetPathFrom in interface IPathFuture<PATH_ELEMENT>public PATH_ELEMENT getPathTo()
IPathFuturegetPathTo in interface IPathFuture<PATH_ELEMENT>public void addFutureListener(cz.cuni.amis.utils.future.IFutureListener<List<PATH_ELEMENT>> listener)
IPathFutureaddFutureListener in interface IPathFuture<PATH_ELEMENT>public void removeFutureListener(cz.cuni.amis.utils.future.IFutureListener<List<PATH_ELEMENT>> listener)
IPathFutureremoveFutureListener in interface IPathFuture<PATH_ELEMENT>public List<PATH_ELEMENT> get()
IPathFutureFuture.get().
May return null if no such path exist.
Throws some runtime exception if the path could not be computed (exact type of exception depends on the implementor of the interface).
get in interface IPathFuture<PATH_ELEMENT>get in interface Future<List<PATH_ELEMENT>>public List<PATH_ELEMENT> get(long timeout, TimeUnit unit)
IPathFutureIPathFuture.getPathFrom() to IPathFuture.getPathTo(). "From" is the first
element of the path, "To" is the last element of the path.
First, see Future.get(long, TimeUnit).
May return null if no such path exist.
Throws some runtime exception if the path could not be computed (exact type of exception depends on the implementor of the interface).
get in interface IPathFuture<PATH_ELEMENT>get in interface Future<List<PATH_ELEMENT>>public cz.cuni.amis.utils.future.FutureStatus getStatus()
IPathFuturegetStatus in interface IPathFuture<PATH_ELEMENT>public boolean isListening(cz.cuni.amis.utils.future.IFutureListener<List<PATH_ELEMENT>> listener)
IPathFutureisListening in interface IPathFuture<PATH_ELEMENT>public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface Future<List<PATH_ELEMENT>>public boolean isCancelled()
isCancelled in interface Future<List<PATH_ELEMENT>>public boolean isDone()
isDone in interface Future<List<PATH_ELEMENT>>Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.