Package org.goplanit.gtfs.reader
Class GtfsReader
- java.lang.Object
-
- org.goplanit.gtfs.reader.GtfsReader
-
public class GtfsReader extends Object
Top level GTFS reader for one or more GTFS files. The ordering in which the file are read (presuming a handler has been registered for them) is:- /
- Author:
- markr
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGtfsReader(URL gtfsLocation, GtfsColumnType gtfsColumnConfiguration)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GtfsFileReaderBaseaddFileHandler(GtfsFileHandler<? extends GtfsObject> gtfsFileHandler)Register a handler for a specific file typevoidread(Charset charSet)Read GTFS files based on the registered file handlers
-
-
-
Constructor Detail
-
GtfsReader
protected GtfsReader(URL gtfsLocation, GtfsColumnType gtfsColumnConfiguration)
Constructor- Parameters:
gtfsLocation- url of the location of the GTFS files, this should either be a directory containing uncompressed *.txt files or alternatively a *.zip file containing the *.txt filesgtfsColumnConfiguration- initial column configuration for all created readers/handlers
-
-
Method Detail
-
read
public void read(Charset charSet)
Read GTFS files based on the registered file handlers- Parameters:
charSet- to use for reading
-
addFileHandler
public GtfsFileReaderBase addFileHandler(GtfsFileHandler<? extends GtfsObject> gtfsFileHandler)
Register a handler for a specific file type- Parameters:
gtfsFileHandler- to register- Returns:
- the file reader that goes with this handler, it is newly created if no reader existed for the file type, otherwise the existing reader is returned
-
-