Class GtfsReaderFactory


  • public class GtfsReaderFactory
    extends Object
    top level class to get things started. Based on location (dir or zip file) and scheme (type of GTFS file), create a single stand-alone GTFS file reader/handler combination, or an umbrella GTFS reader that is capable of registering multiple file readers/handlers
    Author:
    markr
    • Constructor Detail

      • GtfsReaderFactory

        public GtfsReaderFactory()
    • Method Detail

      • createDefaultReader

        public static GtfsReader createDefaultReader​(URL gtfsLocation)
        Factory method to create a GTFS reader supporting one or more file readers where all columns will be parsed by default
        Parameters:
        gtfsLocation - to use to extract GTFS file(s) from (expected to be local file path or resource)
        Returns:
        created reader
      • createFileReader

        public static GtfsFileReaderBase createFileReader​(GtfsFileScheme fileScheme,
                                                          String gtfsLocation,
                                                          GtfsColumnType columnType)
        Identical to createFileReader(GtfsFileScheme, URL, GtfsColumnType) only allowing for string based gtfs location reflecting a path to gtfs file
        Parameters:
        fileScheme - to apply
        gtfsLocation - to use (expected to be local file path or resource)
        columnType - the way we configure the initial included columns across all GTFS files
        Returns:
        created file reader based on scheme
      • createFileReader

        public static GtfsFileReaderBase createFileReader​(GtfsFileScheme fileScheme,
                                                          URL gtfsLocation)
        Factory method to create a GTFS file specific reader with all columns initially included enforcing the file is present (otherwise why other having a reader)
        Parameters:
        fileScheme - to create reader for
        gtfsLocation - URL to use to extract GTFS file from, URL based so more versatile than a local String based file (jar, resources, etc)
        Returns:
        created file reader
      • createFileReader

        public static GtfsFileReaderBase createFileReader​(GtfsFileScheme fileScheme,
                                                          URL gtfsLocation,
                                                          GtfsColumnType columnType)
        Factory method to create a GTFS file specific reader enforcing the file is present (otherwise why other having a reader)
        Parameters:
        fileScheme - to create reader for
        gtfsLocation - to use to extract GTFS file from
        columnType - the way we configure the initial included columns across all GTFS files
        Returns:
        created file reader
      • createFileReader

        public static GtfsFileReaderBase createFileReader​(GtfsFileScheme fileScheme,
                                                          URL gtfsLocation,
                                                          GtfsColumnType columnType,
                                                          GtfsFileConditions conditions)
        Factory method to create a GTFS file specific reader
        Parameters:
        fileScheme - to create reader for
        gtfsLocation - to use to extract GTFS file from
        columnType - the way we configure the initial included columns across all GTFS files
        conditions - to apply regarding presence
        Returns:
        created file reader