Package org.goplanit.gtfs.converter
Class GtfsConverterHandlerData
- java.lang.Object
-
- org.goplanit.gtfs.converter.GtfsConverterHandlerData
-
- Direct Known Subclasses:
GtfsServicesHandlerData
,GtfsZoningHandlerData
,GtfsZoningHandlerTransferZoneData
public class GtfsConverterHandlerData extends Object
Base class with shared data used by all derived classes
-
-
Constructor Summary
Constructors Constructor Description GtfsConverterHandlerData(ServiceNetwork serviceNetwork, GtfsConverterReaderSettingsWithModeMapping settings)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SortedSet<Mode>
expandWithCompatibleModes(Mode planitMode)
Expand the mode to all compatible modes (if any) including the mode itselfSet<Mode>
getActivatedPlanitModesByGtfsMode()
activated planit modes, note that initialise should have been called before this is populatedList<Mode>
getCompatiblePlanitModesIfActivated(RouteType gtfsMode)
Collect PLANit modes if it is known as being activated and compatible (unmodifiable), otherwise return nullSortedSet<Mode>
getCompatiblePlanitModesIfActivated(Mode planitMode)
Collect compatible PLANit modes from a given PLANit mode (if any).Mode
getPrimaryPlanitModeIfActivated(RouteType gtfsMode)
Collect PLANit mode if it is known as being activated, otherwise return nullServiceNetwork
getServiceNetwork()
Access to the service networkGtfsConverterReaderSettingsWithModeMapping
getSettings()
Access to GTFS zoning reader settings
-
-
-
Constructor Detail
-
GtfsConverterHandlerData
public GtfsConverterHandlerData(ServiceNetwork serviceNetwork, GtfsConverterReaderSettingsWithModeMapping settings)
Constructor- Parameters:
serviceNetwork
- to usesettings
- to use
-
-
Method Detail
-
getServiceNetwork
public ServiceNetwork getServiceNetwork()
Access to the service network- Returns:
- the service network being populated
-
getActivatedPlanitModesByGtfsMode
public Set<Mode> getActivatedPlanitModesByGtfsMode()
activated planit modes, note that initialise should have been called before this is populated- Returns:
- activated planit mode instances including predefined mode versions
-
getPrimaryPlanitModeIfActivated
public Mode getPrimaryPlanitModeIfActivated(RouteType gtfsMode)
Collect PLANit mode if it is known as being activated, otherwise return null- Parameters:
gtfsMode
- to check for- Returns:
- PLANit mode
-
getCompatiblePlanitModesIfActivated
public List<Mode> getCompatiblePlanitModesIfActivated(RouteType gtfsMode)
Collect PLANit modes if it is known as being activated and compatible (unmodifiable), otherwise return null- Parameters:
gtfsMode
- to check for- Returns:
- all compatible PLANit modes in order from primary compatible to alternatives that one might consider, null if not present
-
getCompatiblePlanitModesIfActivated
public SortedSet<Mode> getCompatiblePlanitModesIfActivated(Mode planitMode)
Collect compatible PLANit modes from a given PLANit mode (if any). These only exist if a GTFS mode listed more than one mapped PLANit mode, e.g. lightrail and tram, in which case lightrail would return tram and vice versa.- Parameters:
planitMode
- to check for- Returns:
- all compatible PLANit modes (unmodifiable)
-
expandWithCompatibleModes
public SortedSet<Mode> expandWithCompatibleModes(Mode planitMode)
Expand the mode to all compatible modes (if any) including the mode itself- Parameters:
planitMode
- to expand- Returns:
- original mode supplemented with any compatible modes
-
getSettings
public GtfsConverterReaderSettingsWithModeMapping getSettings()
Access to GTFS zoning reader settings- Returns:
- user configuration settings
-
-