jfreerails.controller
Class PathOnTrackFinder

java.lang.Object
  extended by jfreerails.controller.PathOnTrackFinder
All Implemented Interfaces:
IncrementalPathFinder

public class PathOnTrackFinder
extends java.lang.Object
implements IncrementalPathFinder

Finds a path along existing track. Used for upgrading or removing track between two points on the track.

Author:
Luke

Field Summary
private static java.util.logging.Logger logger
           
private  SimpleAStarPathFinder pathFinder
           
private  ImPoint startPoint
           
private  ReadOnlyWorld world
           
 
Fields inherited from interface jfreerails.controller.IncrementalPathFinder
PATH_FOUND, PATH_NOT_FOUND, SEARCH_NOT_STARTED, SEARCH_PAUSED
 
Constructor Summary
PathOnTrackFinder(ReadOnlyWorld world)
           
 
Method Summary
 void abandonSearch()
           
 int getStatus()
           
 Step[] pathAsVectors()
           
 void search(long maxDuration)
           
 void setupSearch(ImPoint from, ImPoint target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final java.util.logging.Logger logger

pathFinder

private SimpleAStarPathFinder pathFinder

startPoint

private ImPoint startPoint

world

private final ReadOnlyWorld world
Constructor Detail

PathOnTrackFinder

public PathOnTrackFinder(ReadOnlyWorld world)
Method Detail

abandonSearch

public void abandonSearch()
Specified by:
abandonSearch in interface IncrementalPathFinder

getStatus

public int getStatus()
Specified by:
getStatus in interface IncrementalPathFinder

pathAsVectors

public Step[] pathAsVectors()

search

public void search(long maxDuration)
            throws PathNotFoundException
Specified by:
search in interface IncrementalPathFinder
Throws:
PathNotFoundException

setupSearch

public void setupSearch(ImPoint from,
                        ImPoint target)
                 throws PathNotFoundException
Throws:
PathNotFoundException