Package org.goplanit.gtfs.reader
Class GtfsReaderFactory
- java.lang.Object
-
- org.goplanit.gtfs.reader.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 Summary
Constructors Constructor Description GtfsReaderFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GtfsReadercreateDefaultReader(URL gtfsLocation)Factory method to create a GTFS reader supporting one or more file readers where all columns will be parsed by defaultstatic GtfsFileReaderBasecreateFileReader(GtfsFileScheme fileScheme, String gtfsLocation)Identical tocreateFileReader(GtfsFileScheme, URL, GtfsColumnType)only allowing for string based gtfs location reflecting a path to gtfs file and setting initially all columns to be parsedstatic GtfsFileReaderBasecreateFileReader(GtfsFileScheme fileScheme, String gtfsLocation, GtfsColumnType columnType)Identical tocreateFileReader(GtfsFileScheme, URL, GtfsColumnType)only allowing for string based gtfs location reflecting a path to gtfs filestatic GtfsFileReaderBasecreateFileReader(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)static GtfsFileReaderBasecreateFileReader(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)static GtfsFileReaderBasecreateFileReader(GtfsFileScheme fileScheme, URL gtfsLocation, GtfsColumnType columnType, GtfsFileConditions conditions)Factory method to create a GTFS file specific reader
-
-
-
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)
Identical tocreateFileReader(GtfsFileScheme, URL, GtfsColumnType)only allowing for string based gtfs location reflecting a path to gtfs file and setting initially all columns to be parsed- Parameters:
fileScheme- to applygtfsLocation- to use (expected to be local file path)- Returns:
- created file reader based on scheme
-
createFileReader
public static GtfsFileReaderBase createFileReader(GtfsFileScheme fileScheme, String gtfsLocation, GtfsColumnType columnType)
Identical tocreateFileReader(GtfsFileScheme, URL, GtfsColumnType)only allowing for string based gtfs location reflecting a path to gtfs file- Parameters:
fileScheme- to applygtfsLocation- 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 forgtfsLocation- 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 forgtfsLocation- to use to extract GTFS file fromcolumnType- 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 forgtfsLocation- to use to extract GTFS file fromcolumnType- the way we configure the initial included columns across all GTFS filesconditions- to apply regarding presence- Returns:
- created file reader
-
-