gov.nasa.arc.brahms.vm.rt
Class ShortestPathAlgorithm.ShortestPath

java.lang.Object
  extended by gov.nasa.arc.brahms.vm.rt.ShortestPathAlgorithm.ShortestPath
Enclosing class:
ShortestPathAlgorithm

public class ShortestPathAlgorithm.ShortestPath
extends java.lang.Object

The ShortestPath specifies the start and end location of the 'traveled' path, the distance of the path and the path taken from the start location to the end location.

Version:
22 June 2000
Author:
Ron van Hoof

Constructor Summary
ShortestPathAlgorithm.ShortestPath(VMAreaCtx start, VMAreaCtx end)
          Constructor, creates a new ShortestPath that will specify the shortest distance and path to get from the specified start location to the specified end location.
 
Method Summary
protected  void addPath(VMAreaCtx nextLocation)
          Adds the next location in the path to the shortest path.
 long getDistance()
          Returns the total distance of the shortest path.
 VMAreaCtx getEndLocation()
          Returns the end location of the shortest path.
 java.util.ListIterator getPath()
          Returns the list of locations on the shortest path to get from the start location to the end location.
 VMAreaCtx getStartLocation()
          Returns the start location of the shortest path.
protected  void setDistance(long distance)
          Sets the total distance of the shortest path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShortestPathAlgorithm.ShortestPath

public ShortestPathAlgorithm.ShortestPath(VMAreaCtx start,
                                          VMAreaCtx end)
Constructor, creates a new ShortestPath that will specify the shortest distance and path to get from the specified start location to the specified end location.

Parameters:
start - the start location
end - the end location
Method Detail

getStartLocation

public final VMAreaCtx getStartLocation()
Returns the start location of the shortest path.

Returns:
VMAreaCtx the start location

getEndLocation

public final VMAreaCtx getEndLocation()
Returns the end location of the shortest path.

Returns:
VMAreaCtx the end location

setDistance

protected final void setDistance(long distance)
Sets the total distance of the shortest path.

Parameters:
distance - the distance

getDistance

public final long getDistance()
Returns the total distance of the shortest path.

Returns:
long the distance

addPath

protected final void addPath(VMAreaCtx nextLocation)
Adds the next location in the path to the shortest path. This method adds the path in reverse order. The algorithm returns the shortest path from end location to start location. Through this method getPath will return the locations starting with the start location.

Parameters:
nextLocation - the next location in the shortest path.

getPath

public final java.util.ListIterator getPath()
Returns the list of locations on the shortest path to get from the start location to the end location. The path includes the start and end location.

Returns:
ListIterator a list of VMAreaCtx


Copyright © 1997-2012 All Rights Reserved.