@Override public List<ServiceCalendarDate> getCalendarDatesForServiceId( AgencyAndId serviceId) { ensureCalendarDatesByServiceIdRelation(); return list(_calendarDatesByServiceId.get(serviceId)); }
@Override public List<ShapePoint> getShapePointsForShapeId(AgencyAndId shapeId) { ensureShapePointRelation(); return list(_shapePointsByShapeId.get(shapeId)); }
@Override public List<ServiceCalendarDate> getCalendarDatesForServiceId( AgencyAndId serviceId) { ensureCalendarDatesByServiceIdRelation(); return list(_calendarDatesByServiceId.get(serviceId)); }
@Override public ServiceCalendar getCalendarForServiceId(AgencyAndId serviceId) { ensureCalendarsByServiceIdRelation(); List<ServiceCalendar> calendars = list(_calendarsByServiceId.get(serviceId)); switch (calendars.size()) { case 0: return null; case 1: return calendars.get(0); } throw new MultipleCalendarsForServiceIdException(serviceId); }
@Override public List<StopTime> getStopTimesForTrip(Trip trip) { if (_stopTimesByTrip == null) { _stopTimesByTrip = mapToValueList(getAllStopTimes(), "trip", Trip.class); for (List<StopTime> stopTimes : _stopTimesByTrip.values()) Collections.sort(stopTimes); } return list(_stopTimesByTrip.get(trip)); }
@Override public ServiceCalendar getCalendarForServiceId(AgencyAndId serviceId) { ensureCalendarsByServiceIdRelation(); List<ServiceCalendar> calendars = list(_calendarsByServiceId.get(serviceId)); switch (calendars.size()) { case 0: return null; case 1: return calendars.get(0); } throw new MultipleCalendarsForServiceIdException(serviceId); }
@Override public List<StopTime> getStopTimesForTrip(Trip trip) { if (_stopTimesByTrip == null) { _stopTimesByTrip = mapToValueList(getAllStopTimes(), "trip", Trip.class); for (List<StopTime> stopTimes : _stopTimesByTrip.values()) Collections.sort(stopTimes); } return list(_stopTimesByTrip.get(trip)); }
@Override public List<Trip> getTripsForRoute(Route route) { if (_tripsByRoute == null) _tripsByRoute = mapToValueList(getAllTrips(), "route", Route.class); return list(_tripsByRoute.get(route)); }
@Override public List<Trip> getTripsForServiceId(AgencyAndId serviceId) { if (_tripsByServiceId == null) { _tripsByServiceId = mapToValueList(getAllTrips(), "serviceId", AgencyAndId.class); } return list(_tripsByServiceId.get(serviceId)); }
@Override public List<Frequency> getFrequenciesForTrip(Trip trip) { if (_frequenciesByTrip == null) _frequenciesByTrip = mapToValueList(getAllFrequencies(), "trip", Trip.class); return list(_frequenciesByTrip.get(trip)); }
@Override public List<FareRule> getFareRulesForFareAttribute(FareAttribute fareAttribute) { if (_fareRulesByFareAttribute == null) { _fareRulesByFareAttribute = mapToValueList(getAllFareRules(), "fare", FareAttribute.class); } return list(_fareRulesByFareAttribute.get(fareAttribute)); }
@Override public List<StopTime> getStopTimesForStop(Stop stop) { if (_stopTimesByStop == null) _stopTimesByStop = mapToValueList(getAllStopTimes(), "stop", Stop.class); return list(_stopTimesByStop.get(stop)); }
@Override public List<Trip> getTripsForShapeId(AgencyAndId shapeId) { if (_tripsByShapeId == null) { _tripsByShapeId = mapToValueList(getAllTrips(), "shapeId", AgencyAndId.class); } return list(_tripsByShapeId.get(shapeId)); }
@Override public List<Route> getRoutesForAgency(Agency agency) { if (_routesByAgency == null) _routesByAgency = mapToValueList(getAllRoutes(), "agency", Agency.class); return list(_routesByAgency.get(agency)); }
@Override public List<StopTime> getStopTimesForStop(Stop stop) { if (_stopTimesByStop == null) _stopTimesByStop = mapToValueList(getAllStopTimes(), "stop", Stop.class); return list(_stopTimesByStop.get(stop)); }
@Override public List<Trip> getTripsForRoute(Route route) { if (_tripsByRoute == null) _tripsByRoute = mapToValueList(getAllTrips(), "route", Route.class); return list(_tripsByRoute.get(route)); }
@Override public List<Route> getRoutesForAgency(Agency agency) { if (_routesByAgency == null) _routesByAgency = mapToValueList(getAllRoutes(), "agency", Agency.class); return list(_routesByAgency.get(agency)); }
@Override public List<Trip> getTripsForServiceId(AgencyAndId serviceId) { if (_tripsByServiceId == null) { _tripsByServiceId = mapToValueList(getAllTrips(), "serviceId", AgencyAndId.class); } return list(_tripsByServiceId.get(serviceId)); }
@Override public List<Trip> getTripsForShapeId(AgencyAndId shapeId) { if (_tripsByShapeId == null) { _tripsByShapeId = mapToValueList(getAllTrips(), "shapeId", AgencyAndId.class); } return list(_tripsByShapeId.get(shapeId)); }
@Override public List<Frequency> getFrequenciesForTrip(Trip trip) { if (_frequenciesByTrip == null) _frequenciesByTrip = mapToValueList(getAllFrequencies(), "trip", Trip.class); return list(_frequenciesByTrip.get(trip)); }