Class ScheduledServiceServiceImpl
- java.lang.Object
-
- org.onebusaway.transit_data_federation.impl.schedule.ScheduledServiceServiceImpl
-
- All Implemented Interfaces:
ScheduleHelperService
@Component public class ScheduledServiceServiceImpl extends Object implements ScheduleHelperService
-
-
Constructor Summary
Constructors Constructor Description ScheduledServiceServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<StopBean>
filterRevenueService(AgencyBean agency, StopsBean stops)
given a list of stops for an agency, filter out the non-revenue stops en masse Included for performance reasons to batch calls.List<String>
getSearchSuggestions(String agencyId, String input)
Given the following partial input, lookup route names that "match".Boolean
routeHasUpcomingScheduledService(String agencyId, long time, String routeId, String directionId)
Check for scheduled service for the given route over the specified time period.Boolean
stopHasRevenueService(String agencyId, String stopId)
Given a stop, test if that stop has revenue service.Boolean
stopHasRevenueServiceOnRoute(String agencyId, String stopId, String routeId, String directionId)
Given a stop, route, and direction, test if that stop has revenue service on the given route in the given direction.Boolean
stopHasUpcomingScheduledService(String stopAgencyId, long time, String stopId, String routeId, String directionId)
Check for scheduled service for the given route/stop pairing over the specified time period.
-
-
-
Method Detail
-
routeHasUpcomingScheduledService
public Boolean routeHasUpcomingScheduledService(String agencyId, long time, String routeId, String directionId)
Description copied from interface:ScheduleHelperService
Check for scheduled service for the given route over the specified time period. That is, are any buses scheduled to visit this route in the next time period?- Specified by:
routeHasUpcomingScheduledService
in interfaceScheduleHelperService
- Parameters:
agencyId
- agency of the routetime
- period to check withinrouteId
- of route to checkdirectionId
- of the route to check- Returns:
- True if scheduled service is found
-
stopHasUpcomingScheduledService
public Boolean stopHasUpcomingScheduledService(String stopAgencyId, long time, String stopId, String routeId, String directionId)
Description copied from interface:ScheduleHelperService
Check for scheduled service for the given route/stop pairing over the specified time period. This is, are any buses scheduled to visit this stop on this route in the next time period?- Specified by:
stopHasUpcomingScheduledService
in interfaceScheduleHelperService
- Parameters:
stopAgencyId
- agency of the routetime
- period of to check withinstopId
- of the stop to checkrouteId
- of the route to checkdirectionId
- of the route to check- Returns:
- True if scheduled service is found
-
stopHasRevenueServiceOnRoute
public Boolean stopHasRevenueServiceOnRoute(String agencyId, String stopId, String routeId, String directionId)
Description copied from interface:ScheduleHelperService
Given a stop, route, and direction, test if that stop has revenue service on the given route in the given direction.- Specified by:
stopHasRevenueServiceOnRoute
in interfaceScheduleHelperService
- Parameters:
agencyId
- Agency ID of stop; used only for routing requests to federated backendsstopId
- Agency-and-ID of stop being testedrouteId
- Agency-and-ID of route to filter fordirectionId
- Direction ID to filter for- Returns:
- true if the stop being tested ever permits boarding or alighting from the specified route in the specified direction in the currently-loaded bundle; false otherwise
-
stopHasRevenueService
public Boolean stopHasRevenueService(String agencyId, String stopId)
Description copied from interface:ScheduleHelperService
Given a stop, test if that stop has revenue service.- Specified by:
stopHasRevenueService
in interfaceScheduleHelperService
- Parameters:
agencyId
- Agency ID of stop; used only for routing requests to federated backendsstopId
- Agency-and-ID of stop being tested- Returns:
- true if the stop being tested ever permits boarding or alighting from any route in any direction in the currently-loaded bundle; false otherwise
-
getSearchSuggestions
public List<String> getSearchSuggestions(String agencyId, String input)
Description copied from interface:ScheduleHelperService
Given the following partial input, lookup route names that "match". The definition of "match" is left to the implementor. This method can be the basis for autocompleting text in a user interface.- Specified by:
getSearchSuggestions
in interfaceScheduleHelperService
- Parameters:
agencyId
- to constrain the search against; may be null.input
- partial text representing a GTFS route short name.- Returns:
- a list of GTFS short names that may qualify.
-
filterRevenueService
public List<StopBean> filterRevenueService(AgencyBean agency, StopsBean stops)
Description copied from interface:ScheduleHelperService
given a list of stops for an agency, filter out the non-revenue stops en masse Included for performance reasons to batch calls.- Specified by:
filterRevenueService
in interfaceScheduleHelperService
-
-