cz.cuni.amis.pogamut.base.agent.navigation.impl
Class PathFuture<PATH_ELEMENT>

Package class diagram package PathFuture
java.lang.Object
  extended by cz.cuni.amis.utils.future.FutureWithListeners<RESULT>
      extended by cz.cuni.amis.pogamut.base.utils.future.ComponentFuture<List<PATH_ELEMENT>>
          extended by cz.cuni.amis.pogamut.base.agent.navigation.impl.PathFuture<PATH_ELEMENT>
Type Parameters:
PATH_ELEMENT -
All Implemented Interfaces:
IPathFuture<PATH_ELEMENT>, cz.cuni.amis.utils.future.IFutureWithListeners<List<PATH_ELEMENT>>, Future<List<PATH_ELEMENT>>

public class PathFuture<PATH_ELEMENT>
extends ComponentFuture<List<PATH_ELEMENT>>
implements IPathFuture<PATH_ELEMENT>

Simple implementation of the IPathFuture interface that assumes the computation to be dependent on some IComponents. Therefore the path future retrieval method (ComponentFuture.get() and ComponentFuture.get(long, java.util.concurrent.TimeUnit)) will fail if one of these components fails.

Author:
Jimmy

Field Summary
 
Fields inherited from class cz.cuni.amis.utils.future.FutureWithListeners
latch, listeners, mutex
 
Constructor Summary
PathFuture(PATH_ELEMENT pathFrom, PATH_ELEMENT pathTo)
          Initialize the path future as independent on any IComponent.
PathFuture(PATH_ELEMENT pathFrom, PATH_ELEMENT pathTo, IComponentBus bus, IComponent... dependants)
          Initialize the path future as dependent on 'dependants'.
 
Method Summary
 PATH_ELEMENT getPathFrom()
          Where does the path start.
 PATH_ELEMENT getPathTo()
          Where does the path end.
 
Methods inherited from class cz.cuni.amis.pogamut.base.utils.future.ComponentFuture
createLatch, get, get
 
Methods inherited from class cz.cuni.amis.utils.future.FutureWithListeners
addFutureListener, cancel, cancelComputation, computationException, getException, getStatus, isCancelled, isDone, isListening, removeFutureListener, setResult, switchStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.base.agent.navigation.IPathFuture
addFutureListener, get, get, getStatus, isListening, removeFutureListener
 
Methods inherited from interface java.util.concurrent.Future
cancel, isCancelled, isDone
 

Constructor Detail

PathFuture

public PathFuture(PATH_ELEMENT pathFrom,
                  PATH_ELEMENT pathTo)
Initialize the path future as independent on any IComponent.

Parameters:
pathFrom -
pathTo -

PathFuture

public PathFuture(PATH_ELEMENT pathFrom,
                  PATH_ELEMENT pathTo,
                  IComponentBus bus,
                  IComponent... dependants)
Initialize the path future as dependent on 'dependants'. If one of the component the path computation depends on fails - the path future will report exception upon getting the path result.

See ComponentFuture.ComponentFuture(IComponentBus, IComponent...) for more details about 'bus' and 'dependants' parameters.

Parameters:
pathFrom -
pathTo -
bus -
depends -
Method Detail

getPathFrom

public PATH_ELEMENT getPathFrom()
Description copied from interface: IPathFuture
Where does the path start. Note that this point might not be the first item of the path element list, this element marks the start location from which the planner has begun.

Specified by:
getPathFrom in interface IPathFuture<PATH_ELEMENT>
Returns:

getPathTo

public PATH_ELEMENT getPathTo()
Description copied from interface: IPathFuture
Where does the path end. Note that this point might not be the last item of the path element list, this element marks the end location to which the planner should plan the path.

Specified by:
getPathTo in interface IPathFuture<PATH_ELEMENT>
Returns:


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.