Search in sources :

Example 1 with ServiceInterval

use of org.onebusaway.gtfs.model.calendar.ServiceInterval in project onebusaway-gtfs-modules by OneBusAway.

the class CalendarServiceImpl method getServiceDates.

private Map<LocalizedServiceId, List<Date>> getServiceDates(ServiceIdIntervals serviceIdIntervals, ServiceIdOp op, Date from, Date to, boolean includeNextDate) {
    CalendarServiceData allData = getData();
    Map<LocalizedServiceId, List<Date>> results = new HashMap<LocalizedServiceId, List<Date>>();
    for (Map.Entry<LocalizedServiceId, ServiceInterval> entry : serviceIdIntervals) {
        LocalizedServiceId serviceId = entry.getKey();
        ServiceInterval interval = entry.getValue();
        List<Date> serviceDates = getServiceDates(allData, serviceId, interval, op, from, to, includeNextDate);
        if (!serviceDates.isEmpty())
            results.put(serviceId, serviceDates);
    }
    return results;
}
Also used : CalendarServiceData(org.onebusaway.gtfs.model.calendar.CalendarServiceData) HashMap(java.util.HashMap) LocalizedServiceId(org.onebusaway.gtfs.model.calendar.LocalizedServiceId) ServiceInterval(org.onebusaway.gtfs.model.calendar.ServiceInterval) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) ServiceDate(org.onebusaway.gtfs.model.calendar.ServiceDate) Date(java.util.Date)

Aggregations

ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 CalendarServiceData (org.onebusaway.gtfs.model.calendar.CalendarServiceData)1 LocalizedServiceId (org.onebusaway.gtfs.model.calendar.LocalizedServiceId)1 ServiceDate (org.onebusaway.gtfs.model.calendar.ServiceDate)1 ServiceInterval (org.onebusaway.gtfs.model.calendar.ServiceInterval)1