Class RouteFinder

java.lang.Object
id.klacak.bus_navigator.RouteFinder

public class RouteFinder extends Object
Searches a transit network for journeys between stops.
  • Constructor Details

    • RouteFinder

      public RouteFinder()
      Creates a route finder.
  • Method Details

    • findRoute

      public static List<Leg> findRoute(Stop startStop, Stop endStop)
      Finds a journey between two stops using the fewest ride legs found by breadth-first search. Travel follows each route's listed stop order and wraps from its last stop to its first.
      Parameters:
      startStop - stop where the journey begins
      endStop - destination stop
      Returns:
      ordered ride legs, or an empty list if either stop is null or no journey exists