Package org.onebusaway.gtfs.impl
Class GtfsDataServiceImpl
- java.lang.Object
-
- org.onebusaway.gtfs.impl.GtfsDataServiceImpl
-
- All Implemented Interfaces:
CalendarService,GenericDao,GtfsDao,GtfsDataService,GtfsRelationalDao
public class GtfsDataServiceImpl extends Object implements GtfsDataService
-
-
Constructor Summary
Constructors Constructor Description GtfsDataServiceImpl()
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.onebusaway.gtfs.services.GtfsDao
hasFaresV1, hasFaresV2
-
-
-
-
Method Detail
-
setGtfsDao
public void setGtfsDao(GtfsRelationalDao dao)
-
getAllEntitiesForType
public <T> Collection<T> getAllEntitiesForType(Class<T> type)
Description copied from interface:GenericDaoGeneric Methods- Specified by:
getAllEntitiesForTypein interfaceGenericDao
-
getEntityForId
public <T> T getEntityForId(Class<T> type, Serializable id)
- Specified by:
getEntityForIdin interfaceGenericDao
-
getAllAgencies
public Collection<Agency> getAllAgencies()
Description copied from interface:GtfsDaoAgency Methods- Specified by:
getAllAgenciesin interfaceGtfsDao
-
getAgencyForId
public Agency getAgencyForId(String id)
- Specified by:
getAgencyForIdin interfaceGtfsDao
-
getAllCalendars
public Collection<ServiceCalendar> getAllCalendars()
Description copied from interface:GtfsDaoServiceCalendarMethods- Specified by:
getAllCalendarsin interfaceGtfsDao
-
getCalendarForId
public ServiceCalendar getCalendarForId(int id)
- Specified by:
getCalendarForIdin interfaceGtfsDao
-
getAllCalendarDates
public Collection<ServiceCalendarDate> getAllCalendarDates()
Description copied from interface:GtfsDaoServiceCalendarDateMethods- Specified by:
getAllCalendarDatesin interfaceGtfsDao
-
getCalendarDateForId
public ServiceCalendarDate getCalendarDateForId(int id)
- Specified by:
getCalendarDateForIdin interfaceGtfsDao
-
getTripAgencyIdsReferencingServiceId
public List<String> getTripAgencyIdsReferencingServiceId(AgencyAndId serviceId)
Description copied from interface:GtfsRelationalDaoServiceId Methods- Specified by:
getTripAgencyIdsReferencingServiceIdin interfaceGtfsRelationalDao
-
getAllFareAttributes
public Collection<FareAttribute> getAllFareAttributes()
Description copied from interface:GtfsDaoFareAttributeMethods- Specified by:
getAllFareAttributesin interfaceGtfsDao
-
getAllFareProducts
public Collection<FareProduct> getAllFareProducts()
Description copied from interface:GtfsDaoFareProductMethods- Specified by:
getAllFareProductsin interfaceGtfsDao- Specified by:
getAllFareProductsin interfaceGtfsDataService
-
getFareProductForId
public FareProduct getFareProductForId(AgencyAndId id)
- Specified by:
getFareProductForIdin interfaceGtfsDao
-
getAllFareMedia
public Collection<FareMedium> getAllFareMedia()
Description copied from interface:GtfsDaoFareMediumMethods- Specified by:
getAllFareMediain interfaceGtfsDao
-
getAllRiderCategories
public Collection<RiderCategory> getAllRiderCategories()
Description copied from interface:GtfsDaoRiderCategoryMethods- Specified by:
getAllRiderCategoriesin interfaceGtfsDao
-
getFareAttributeForId
public FareAttribute getFareAttributeForId(AgencyAndId id)
- Specified by:
getFareAttributeForIdin interfaceGtfsDao
-
getAllFareLegRules
public Collection<FareLegRule> getAllFareLegRules()
Description copied from interface:GtfsDaoFareLegRuleMethods- Specified by:
getAllFareLegRulesin interfaceGtfsDao
-
getRoutesForAgency
public List<Route> getRoutesForAgency(Agency agency)
Description copied from interface:GtfsRelationalDaoRoute Methods- Specified by:
getRoutesForAgencyin interfaceGtfsRelationalDao
-
getAllFareRules
public Collection<FareRule> getAllFareRules()
Description copied from interface:GtfsDaoFareRuleMethods- Specified by:
getAllFareRulesin interfaceGtfsDao
-
getStopsForStation
public List<Stop> getStopsForStation(Stop station)
Description copied from interface:GtfsRelationalDaoStop Methods- Specified by:
getStopsForStationin interfaceGtfsRelationalDao
-
getStopsForZoneId
public List<Stop> getStopsForZoneId(String zoneId)
- Specified by:
getStopsForZoneIdin interfaceGtfsRelationalDao
-
getFareRuleForId
public FareRule getFareRuleForId(int id)
- Specified by:
getFareRuleForIdin interfaceGtfsDao
-
getAllFareTransferRules
public Collection<FareTransferRule> getAllFareTransferRules()
Description copied from interface:GtfsDaoFareTransferRuleMethods- Specified by:
getAllFareTransferRulesin interfaceGtfsDao
-
getTripsForRoute
public List<Trip> getTripsForRoute(Route route)
Description copied from interface:GtfsRelationalDaoTripMethods- Specified by:
getTripsForRoutein interfaceGtfsRelationalDao
-
getAllFeedInfos
public Collection<FeedInfo> getAllFeedInfos()
Description copied from interface:GtfsDaoFeedInfoMethods- Specified by:
getAllFeedInfosin interfaceGtfsDao
-
getTripsForShapeId
public List<Trip> getTripsForShapeId(AgencyAndId shapeId)
- Specified by:
getTripsForShapeIdin interfaceGtfsRelationalDao
-
getFeedInfoForId
public FeedInfo getFeedInfoForId(String id)
- Specified by:
getFeedInfoForIdin interfaceGtfsDao
-
getTripsForServiceId
public List<Trip> getTripsForServiceId(AgencyAndId serviceId)
- Specified by:
getTripsForServiceIdin interfaceGtfsRelationalDao
-
getTripsForBlockId
public List<Trip> getTripsForBlockId(AgencyAndId blockId)
- Specified by:
getTripsForBlockIdin interfaceGtfsRelationalDao
-
getAllFrequencies
public Collection<Frequency> getAllFrequencies()
Description copied from interface:GtfsDaoFrequencyMethods- Specified by:
getAllFrequenciesin interfaceGtfsDao
-
getFrequencyForId
public Frequency getFrequencyForId(int id)
- Specified by:
getFrequencyForIdin interfaceGtfsDao
-
getAllPathways
public Collection<Pathway> getAllPathways()
Description copied from interface:GtfsDaoPathwayMethods- Specified by:
getAllPathwaysin interfaceGtfsDao
-
getPathwayForId
public Pathway getPathwayForId(AgencyAndId id)
- Specified by:
getPathwayForIdin interfaceGtfsDao
-
getAllLevels
public Collection<Level> getAllLevels()
- Specified by:
getAllLevelsin interfaceGtfsDao
-
getLevelForId
public Level getLevelForId(AgencyAndId id)
- Specified by:
getLevelForIdin interfaceGtfsDao
-
getStopTimesForTrip
public List<StopTime> getStopTimesForTrip(Trip trip)
- Specified by:
getStopTimesForTripin interfaceGtfsRelationalDao- Returns:
- the list of
StopTimeobjects associated with the trip, sorted byStopTime.getStopSequence()
-
getAllRoutes
public Collection<Route> getAllRoutes()
Description copied from interface:GtfsDaoRouteMethods- Specified by:
getAllRoutesin interfaceGtfsDao
-
getAllRouteStops
public Collection<RouteStop> getAllRouteStops()
- Specified by:
getAllRouteStopsin interfaceGtfsDao
-
getAllRouteShapes
public Collection<RouteShape> getAllRouteShapes()
- Specified by:
getAllRouteShapesin interfaceGtfsDao
-
getRouteForId
public Route getRouteForId(AgencyAndId id)
- Specified by:
getRouteForIdin interfaceGtfsDao
-
getAllShapePoints
public Collection<ShapePoint> getAllShapePoints()
Description copied from interface:GtfsDaoShapePointMethods- Specified by:
getAllShapePointsin interfaceGtfsDao
-
getStopTimesForStop
public List<StopTime> getStopTimesForStop(Stop stop)
- Specified by:
getStopTimesForStopin interfaceGtfsRelationalDao- Returns:
- the list of
StopTimeobjects associated with the specifiedStop, in no particular order
-
getShapePointForId
public ShapePoint getShapePointForId(int id)
- Specified by:
getShapePointForIdin interfaceGtfsDao
-
getAllShapeIds
public List<AgencyAndId> getAllShapeIds()
Description copied from interface:GtfsRelationalDaoShapePointMethods- Specified by:
getAllShapeIdsin interfaceGtfsRelationalDao
-
getAllStops
public Collection<Stop> getAllStops()
Description copied from interface:GtfsDaoStopMethods- Specified by:
getAllStopsin interfaceGtfsDao
-
getShapePointsForShapeId
public List<ShapePoint> getShapePointsForShapeId(AgencyAndId shapeId)
- Specified by:
getShapePointsForShapeIdin interfaceGtfsRelationalDao
-
getStopForId
public Stop getStopForId(AgencyAndId id)
- Specified by:
getStopForIdin interfaceGtfsDao
-
getAllStopTimes
public Collection<StopTime> getAllStopTimes()
Description copied from interface:GtfsDaoStopTimeMethods- Specified by:
getAllStopTimesin interfaceGtfsDao
-
getFrequenciesForTrip
public List<Frequency> getFrequenciesForTrip(Trip trip)
Description copied from interface:GtfsRelationalDaoFrequencyMethods- Specified by:
getFrequenciesForTripin interfaceGtfsRelationalDao
-
getStopTimeForId
public StopTime getStopTimeForId(int id)
- Specified by:
getStopTimeForIdin interfaceGtfsDao
-
getAllServiceIds
public List<AgencyAndId> getAllServiceIds()
Description copied from interface:GtfsRelationalDaoServiceCalendarMethods- Specified by:
getAllServiceIdsin interfaceGtfsRelationalDao
-
getAllTransfers
public Collection<Transfer> getAllTransfers()
Description copied from interface:GtfsDaoTransferMethods- Specified by:
getAllTransfersin interfaceGtfsDao
-
getCalendarForServiceId
public ServiceCalendar getCalendarForServiceId(AgencyAndId serviceId)
- Specified by:
getCalendarForServiceIdin interfaceGtfsRelationalDao
-
getTransferForId
public Transfer getTransferForId(int id)
- Specified by:
getTransferForIdin interfaceGtfsDao
-
getAllTrips
public Collection<Trip> getAllTrips()
Description copied from interface:GtfsDaoTripMethods- Specified by:
getAllTripsin interfaceGtfsDao
-
getTripForId
public Trip getTripForId(AgencyAndId id)
- Specified by:
getTripForIdin interfaceGtfsDao
-
getCalendarDatesForServiceId
public List<ServiceCalendarDate> getCalendarDatesForServiceId(AgencyAndId serviceId)
Description copied from interface:GtfsRelationalDaoServiceCalendarDateMethods- Specified by:
getCalendarDatesForServiceIdin interfaceGtfsRelationalDao
-
getAllBlocks
public Collection<Block> getAllBlocks()
- Specified by:
getAllBlocksin interfaceGtfsDao
-
getBlockForId
public Block getBlockForId(int id)
- Specified by:
getBlockForIdin interfaceGtfsDao
-
getFareRulesForFareAttribute
public List<FareRule> getFareRulesForFareAttribute(FareAttribute fareAttribute)
Description copied from interface:GtfsRelationalDao- Specified by:
getFareRulesForFareAttributein interfaceGtfsRelationalDao
-
getFareRulesForRoute
public List<FareRule> getFareRulesForRoute(Route route)
- Specified by:
getFareRulesForRoutein interfaceGtfsRelationalDao
-
getFareRulesForZoneId
public List<FareRule> getFareRulesForZoneId(String zoneId)
- Specified by:
getFareRulesForZoneIdin interfaceGtfsRelationalDao
-
getAllRiderships
public Collection<Ridership> getAllRiderships()
- Specified by:
getAllRidershipsin interfaceGtfsDao
-
getAllVehicles
public Collection<Vehicle> getAllVehicles()
Description copied from interface:GtfsDaoVehicleMethods- Specified by:
getAllVehiclesin interfaceGtfsDao
-
getVehicleForId
public Vehicle getVehicleForId(AgencyAndId id)
Description copied from interface:GtfsDaoVehicleMethods- Specified by:
getVehicleForIdin interfaceGtfsDao
-
getAllAreas
public Collection<Area> getAllAreas()
Description copied from interface:GtfsDaoAreaMethods- Specified by:
getAllAreasin interfaceGtfsDao
-
getAllLocationGroupElements
public Collection<LocationGroupElement> getAllLocationGroupElements()
- Specified by:
getAllLocationGroupElementsin interfaceGtfsDao
-
getAllStopAreaElements
public Collection<StopAreaElement> getAllStopAreaElements()
- Specified by:
getAllStopAreaElementsin interfaceGtfsDao
-
getAllStopAreas
public Collection<StopArea> getAllStopAreas()
- Specified by:
getAllStopAreasin interfaceGtfsDao
-
getAllLocationGroups
public Collection<LocationGroup> getAllLocationGroups()
- Specified by:
getAllLocationGroupsin interfaceGtfsDao
-
getAllLocations
public Collection<Location> getAllLocations()
- Specified by:
getAllLocationsin interfaceGtfsDao
-
getAllBookingRules
public Collection<BookingRule> getAllBookingRules()
- Specified by:
getAllBookingRulesin interfaceGtfsDao
-
getAllTranslations
public Collection<Translation> getAllTranslations()
Description copied from interface:GtfsDaoTranslationMethods- Specified by:
getAllTranslationsin interfaceGtfsDao
-
getOptionalMetadataFilenames
public List<String> getOptionalMetadataFilenames()
- Specified by:
getOptionalMetadataFilenamesin interfaceGtfsDao
-
hasMetadata
public boolean hasMetadata(String filename)
- Specified by:
hasMetadatain interfaceGtfsDao
-
getMetadata
public String getMetadata(String filename)
- Specified by:
getMetadatain interfaceGtfsDao
-
addMetadata
public void addMetadata(String filename, String content)
- Specified by:
addMetadatain interfaceGtfsDao
-
getRidershipForTrip
public List<Ridership> getRidershipForTrip(AgencyAndId tripId)
Description copied from interface:GtfsRelationalDao- Specified by:
getRidershipForTripin interfaceGtfsRelationalDao
-
getServiceIds
public Set<AgencyAndId> getServiceIds()
- Specified by:
getServiceIdsin interfaceCalendarService- Returns:
- the set of all service ids used in the data set
-
getServiceDatesForServiceId
public Set<ServiceDate> getServiceDatesForServiceId(AgencyAndId serviceId)
- Specified by:
getServiceDatesForServiceIdin interfaceCalendarService- Parameters:
serviceId- the target service id- Returns:
- the set of all service dates for which the specified service id is active
-
getServiceIdsOnDate
public Set<AgencyAndId> getServiceIdsOnDate(ServiceDate date)
Description copied from interface:CalendarServiceDetermine the set of service ids that are active on the specified service date.- Specified by:
getServiceIdsOnDatein interfaceCalendarService- Parameters:
date- the target service date- Returns:
- the set of service ids that are active on the specified service date
-
getTimeZoneForAgencyId
public TimeZone getTimeZoneForAgencyId(String agencyId)
Description copied from interface:CalendarServiceReturns the instantiatedTimeZonefor the specified agency id- Specified by:
getTimeZoneForAgencyIdin interfaceCalendarService- Parameters:
agencyId-Agency.getId()- Returns:
- the time zone for the specified agency, or null if the agency was not found
-
getLocalizedServiceIdForAgencyAndServiceId
public LocalizedServiceId getLocalizedServiceIdForAgencyAndServiceId(String agencyId, AgencyAndId serviceId)
Description copied from interface:CalendarServiceGiven an agency id and a service id, we return aLocalizedServiceIdwhich is just a service id with timezone information attached. We use the agencyId argument of the method call to lookup the timezone for requested agency. Note that the service id itself has an agencyId component as well, but we don't use that for the timezone lookup. The service id's agencyId is more of a prefix to guarantee dataset uniqueness. For example, multipleTripobjects, representing different agencies, can all reference the same service id. Its important that we look up agency timezone information using the trip's agencyId and not the serviceId's agencyId.- Specified by:
getLocalizedServiceIdForAgencyAndServiceIdin interfaceCalendarService- Parameters:
agencyId- the id of the Agency whose timezone info we will useserviceId- the service id to use- Returns:
- a localized service id with timezone info attached, or nul if the specified agency could not be found
-
getDatesForLocalizedServiceId
public List<Date> getDatesForLocalizedServiceId(LocalizedServiceId localizedServiceId)
- Specified by:
getDatesForLocalizedServiceIdin interfaceCalendarService
-
isLocalizedServiceIdActiveOnDate
public boolean isLocalizedServiceIdActiveOnDate(LocalizedServiceId localizedServiceId, Date serviceDate)
- Specified by:
isLocalizedServiceIdActiveOnDatein interfaceCalendarService
-
getServiceDatesWithinRange
public List<Date> getServiceDatesWithinRange(LocalizedServiceId serviceId, ServiceInterval interval, Date from, Date to)
Description copied from interface:CalendarServiceGiven the specified localized service id, which has a corresponding set of localized service dates, determine the sublist of service dates that, when extended with the specifiedServiceInterval, overlap with the specified from-to time range. Let's consider a few concrete examples to describe what this method does. Consider a singleStopTimewith an arrival and departure time. That StopTime is part of aTrip, which means it has a service id attached to it. We wish to answer the question, What service dates would make the specified StopTime active in a particular time range? To answer that question, we'd need to consider each of the localized service dates for which the specified service id is active, add the StopTime arrival and departure offset to each, and see if the resulting time falls within the target range. This method can perform that comparison. By specifying the target service id, aServiceIntervalwhose min and max arrival and departure times are set to the arrival and departure time of theStopTime, and the target from-to time interval, the method will return the set of localized service dates that would make the StopTime arrival or departure times active in the specified target time range. As slightly different example, consider answering that same question for multipleStopTimeobjects, such as all the StopTimes for a particular trip or all the StopTimes for a particular stop. The question is the same, but the difference is now there are multiple arrival and departure times. Here, an appropriateServiceIntervalcan be constructed that includes the min and max arrival and departure times for the set ofStopTimeobjects and the calculation will be done looking for service dates that cause any part of the service interval to overlap with the target from-to range. Note that this method considers both the arrival and departure times when looking for overlaps. To consider only arrival times, check outCalendarService.getServiceDateArrivalsWithinRange(LocalizedServiceId, ServiceInterval, Date, Date)and for departures, check outCalendarService.getServiceDateDeparturesWithinRange(LocalizedServiceId, ServiceInterval, Date, Date)- Specified by:
getServiceDatesWithinRangein interfaceCalendarService- Parameters:
serviceId- the localized service id whose service dates we'll considerinterval- a range of arrival and departure times to considerfrom- - the min portion of the target time intervalto- - the max portion of the target time interval- Returns:
- the list of localized service dates that would make the specified service interval overlap with the specified from-to time range
-
getServiceDatesWithinRange
public Map<LocalizedServiceId,List<Date>> getServiceDatesWithinRange(ServiceIdIntervals serviceIdIntervals, Date from, Date to)
Description copied from interface:CalendarServiceSee the description fromCalendarService.getServiceDatesWithinRange(LocalizedServiceId, ServiceInterval, Date, Date). This method does the same thing, except that it works with multiple service ids and intervals at the same time.- Specified by:
getServiceDatesWithinRangein interfaceCalendarService- Parameters:
serviceIdIntervals- - a set of service ids and service intervalsfrom- - time interval minto- - time interval max- Returns:
- the list of active service dates, keyed by service id
-
getServiceDateDeparturesWithinRange
public List<Date> getServiceDateDeparturesWithinRange(LocalizedServiceId serviceId, ServiceInterval interval, Date from, Date to)
Description copied from interface:CalendarServiceSee the description fromCalendarService.getServiceDatesWithinRange(LocalizedServiceId, ServiceInterval, Date, Date). This method does the same thing, except that it only considers departure times.- Specified by:
getServiceDateDeparturesWithinRangein interfaceCalendarService- Parameters:
serviceId- the localized service id whose service dates we'll considerinterval- a range of departure times to considerfrom- - the min portion of the target time intervalto- - the max portion of the target time interval- Returns:
- the list of active service dates
-
getServiceDateDeparturesWithinRange
public Map<LocalizedServiceId,List<Date>> getServiceDateDeparturesWithinRange(ServiceIdIntervals serviceIdIntervals, Date from, Date to)
Description copied from interface:CalendarServiceSee the description fromCalendarService.getServiceDateDeparturesWithinRange(LocalizedServiceId, ServiceInterval, Date, Date). This method does the same thing, except that it works with multiple service ids and intervals at the same time.- Specified by:
getServiceDateDeparturesWithinRangein interfaceCalendarService- Parameters:
serviceIdIntervals- - a set of service ids and service intervalsfrom- - time interval minto- - time interval max- Returns:
- the list of active service dates, keyed by service id
-
getServiceDateArrivalsWithinRange
public List<Date> getServiceDateArrivalsWithinRange(LocalizedServiceId serviceId, ServiceInterval interval, Date from, Date to)
Description copied from interface:CalendarServiceSee the description fromCalendarService.getServiceDatesWithinRange(LocalizedServiceId, ServiceInterval, Date, Date). This method does the same thing, except that it only considers arrival times.- Specified by:
getServiceDateArrivalsWithinRangein interfaceCalendarService- Parameters:
serviceId- the localized service id whose service dates we'll considerinterval- a range of arrival times to considerfrom- - the min portion of the target time intervalto- - the max portion of the target time interval- Returns:
- the list of active service dates
-
isLocalizedServiceIdActiveInRange
public boolean isLocalizedServiceIdActiveInRange(LocalizedServiceId serviceId, ServiceInterval scheduledService, AgencyServiceInterval serviceInterval)
- Specified by:
isLocalizedServiceIdActiveInRangein interfaceCalendarService
-
getServiceDateArrivalsWithinRange
public Map<LocalizedServiceId,List<Date>> getServiceDateArrivalsWithinRange(ServiceIdIntervals serviceIdIntervals, Date from, Date to)
Description copied from interface:CalendarServiceSee the description fromCalendarService.getServiceDateArrivalsWithinRange(LocalizedServiceId, ServiceInterval, Date, Date). This method does the same thing, except that it works with multiple service ids and intervals at the same time.- Specified by:
getServiceDateArrivalsWithinRangein interfaceCalendarService- Parameters:
serviceIdIntervals- - a set of service ids and service intervalsfrom- - time interval minto- - time interval max- Returns:
- the list of active service dates, keyed by service id
-
getNextDepartureServiceDates
public List<Date> getNextDepartureServiceDates(LocalizedServiceId serviceId, ServiceInterval interval, long targetTime)
Description copied from interface:CalendarServiceComputes the list of service dates whose departure service interval (min to max departure time) overlaps the specified target time. If no intervals overlaps, then the next service date whose full service interval comes immediately after (but does overlap) the target time is returned. This method is useful for finding the next scheduledStopTimeafter the target time at a particular stop . By calling this method with the serviceId and service interval for the specified stop, we return the set of service dates that overlap or the next service date if none do, guaranteeing that at least one service date instantiates a StopTime that occurs after the target time.- Specified by:
getNextDepartureServiceDatesin interfaceCalendarService- Parameters:
serviceId- the localized service id whose service dates we'll considerinterval- a range of departure times to considertargetTime- - time in UTC- Returns:
- the set of overlapping and next service dates
-
getNextDepartureServiceDates
public Map<LocalizedServiceId,List<Date>> getNextDepartureServiceDates(ServiceIdIntervals serviceIdIntervals, long targetTime)
Description copied from interface:CalendarServiceSee the description forCalendarService.getNextDepartureServiceDates(LocalizedServiceId, ServiceInterval, long). This method does the same thing, except that it works with multiple service ids and intervals at the same time.- Specified by:
getNextDepartureServiceDatesin interfaceCalendarService- Parameters:
serviceIdIntervals- - set of service ids and service intervals- Returns:
- the set of overlapping and next service dates
-
getPreviousArrivalServiceDates
public List<Date> getPreviousArrivalServiceDates(LocalizedServiceId serviceId, ServiceInterval interval, long targetTime)
Description copied from interface:CalendarServiceComputes the list of service dates whose arrival service interval (min to max departure time) overlaps the specified target time. If not intervals overlap, then the previous service date whose full service interval comes immediately before (but does overlap) the target time is returned. This method is useful for finding the previous scheduledStopTimebefore the target time at a particular stop . By calling this method with the serviceId and service interval for the specified stop, we return the set of service dates that potentially overlap or the previous service date if none do, guaranteeing that at least one service date instantiates a StopTime that occurs before the target time.- Specified by:
getPreviousArrivalServiceDatesin interfaceCalendarService- Parameters:
serviceId- the localized service id whose service dates we'll considerinterval- a range of arrival times to considertargetTime- - time in UTC- Returns:
- the set of overlapping and previous service dates
-
getPreviousArrivalServiceDates
public Map<LocalizedServiceId,List<Date>> getPreviousArrivalServiceDates(ServiceIdIntervals serviceIdIntervals, long targetTime)
Description copied from interface:CalendarServiceSee the description forCalendarService.getPreviousArrivalServiceDates(LocalizedServiceId, ServiceInterval, long). This method does the same thing, except that it works with multiple service ids and intervals at the same time.- Specified by:
getPreviousArrivalServiceDatesin interfaceCalendarService- Parameters:
serviceIdIntervals- - set of service ids and service intervals- Returns:
- the set of overlapping and previous service dates
-
setData
public void setData(CalendarServiceData data)
Description copied from interface:CalendarServiceUpdate the underlying data structures.- Specified by:
setDatain interfaceCalendarService
-
getFacilityForId
public Facility getFacilityForId(AgencyAndId id)
-
getFacilityPropertiesForId
public FacilityProperty getFacilityPropertiesForId(AgencyAndId id)
-
getFacilityPropertiesDefinitionsForId
public FacilityPropertyDefinition getFacilityPropertiesDefinitionsForId(AgencyAndId id)
-
getRouteNameExceptionForId
public RouteNameException getRouteNameExceptionForId(AgencyAndId id)
-
getDirectionNameExceptionForId
public DirectionNameException getDirectionNameExceptionForId(AgencyAndId id)
-
getAlternateStopNameExceptionForId
public AlternateStopNameException getAlternateStopNameExceptionForId(AgencyAndId id)
-
getAllFacilities
public Collection<Facility> getAllFacilities()
-
getAllFacilityProperties
public Collection<FacilityProperty> getAllFacilityProperties()
-
getAllFacilityPropertyDefinitions
public Collection<FacilityPropertyDefinition> getAllFacilityPropertyDefinitions()
-
getAllRouteNameExceptions
public Collection<RouteNameException> getAllRouteNameExceptions()
-
getAllDirectionNameExceptions
public Collection<DirectionNameException> getAllDirectionNameExceptions()
-
getAllAlternateStopNameExceptions
public Collection<AlternateStopNameException> getAllAlternateStopNameExceptions()
-
getAllDirectionEntries
public Collection<DirectionEntry> getAllDirectionEntries()
- Specified by:
getAllDirectionEntriesin interfaceGtfsDao
-
getAllWrongWayConcurrencies
public Collection<WrongWayConcurrency> getAllWrongWayConcurrencies()
- Specified by:
getAllWrongWayConcurrenciesin interfaceGtfsDao
-
-