Class TransitNetworkLoader

java.lang.Object
id.klacak.bus_navigator.TransitNetworkLoader

public class TransitNetworkLoader extends Object
Loads transit networks from XML resources on the application classpath.
  • Constructor Details

    • TransitNetworkLoader

      public TransitNetworkLoader()
      Creates a transit-network loader.
  • Method Details

    • load

      public static TransitNetwork load(String xmlPath) throws Exception
      Loads routes and stops from a classpath XML resource. A leading ./ is ignored when resolving the resource path.
      Parameters:
      xmlPath - path of the XML resource relative to the classpath root
      Returns:
      the transit network described by the resource
      Throws:
      Exception - if the resource is missing or cannot be parsed
    • main

      public static void main(String[] args) throws Exception
      Prints every loaded route and its stops to standard output.
      Parameters:
      args - command-line arguments (unused)
      Throws:
      Exception - if the transit network resource cannot be loaded