Package org.onebusaway.gtfs.model.calendar

Examples of org.onebusaway.gtfs.model.calendar.CalendarServiceData


        return edge.getId();
    }

    public CalendarService getCalendarService() {
        if (calendarService == null) {
            CalendarServiceData data = this.getService(CalendarServiceData.class);
            if (data != null) {
                CalendarServiceImpl calendarService = new CalendarServiceImpl();
                calendarService.setData(data);
                this.calendarService = calendarService;
            }
View Full Code Here


        firstTripTimes.serviceCode = graph.serviceCodes.get(firstTrip.getId());
        secondTripTimes.serviceCode = graph.serviceCodes.get(secondTrip.getId());
        thirdTripTimes.serviceCode = graph.serviceCodes.get(thirdTrip.getId());

        CalendarServiceData calendarServiceData = new CalendarServiceDataStub(graph.serviceCodes.keySet());
        CalendarServiceImpl calendarServiceImpl = new CalendarServiceImpl(calendarServiceData);

        calendarServiceData.putTimeZoneForAgencyId("Train", timeZone);
        calendarServiceData.putTimeZoneForAgencyId("Ferry", timeZone);

        FareServiceStub fareServiceStub = new FareServiceStub();

        ServiceDate serviceDate = new ServiceDate(1970, 1, 1);
View Full Code Here

        return new GtfsContextImpl(dao, calendarService);
    }

    public static CalendarService createCalendarService(GtfsRelationalDao dao) {
        CalendarServiceData data = createCalendarServiceData(dao);
        CalendarServiceImpl service = new CalendarServiceImpl();
        service.setData(data);
        return service;
    }
View Full Code Here

*
*/
public class MultiCalendarServiceImpl extends CalendarServiceImpl {

    public MultiCalendarServiceImpl() {
        setData(new CalendarServiceData());
    }
View Full Code Here

    }

    public static CalendarServiceData createCalendarServiceData(GtfsRelationalDao dao) {
        CalendarServiceDataFactoryImpl factory = new CalendarServiceDataFactoryImpl();
        factory.setGtfsDao(dao);
        CalendarServiceData data = factory.createData();
        return data;
    }
View Full Code Here

    public MultiCalendarServiceImpl() {
        setData(new CalendarServiceData());
    }

    public void addData(CalendarServiceData data, GtfsRelationalDao dao) {
        CalendarServiceData _data = super.getData();
        for (Agency agency : dao.getAllAgencies()) {
            String agencyId = agency.getId();
            _data.putTimeZoneForAgencyId(agencyId, data.getTimeZoneForAgencyId(agencyId));
        }
        for (LocalizedServiceId id : data.getLocalizedServiceIds()) {
            _data.putDatesForLocalizedServiceId(id, data.getDatesForLocalizedServiceId(id));
        }
        for (AgencyAndId serviceId : data.getServiceIds()) {
            _data.putServiceDatesForServiceId(serviceId,
                    data.getServiceDatesForServiceId(serviceId));
        }
    }
View Full Code Here

                loadBundle(gtfsBundle, graph, dao);

                CalendarServiceDataFactoryImpl csfactory = new CalendarServiceDataFactoryImpl();
                csfactory.setGtfsDao(dao);
                CalendarServiceData data = csfactory.createData();
                service.addData(data, dao);

                hf.setDefaultStreetToStopTime(gtfsBundle.getDefaultStreetToStopTime());
                hf.run(graph);

                if (gtfsBundle.doesTransfersTxtDefineStationPaths()) {
                    hf.createTransfersTxtTransfers();
                }
                if (gtfsBundle.linkStopsToParentStations) {
                    hf.linkStopsToParentStations(graph);
                }
                if (gtfsBundle.parentStationTransfers) {
                    hf.createParentStationTransfers();
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        // We need to save the calendar service data so we can use it later
        CalendarServiceData data = service.getData();
        graph.putService(CalendarServiceData.class, data);
        graph.updateTransitFeedValidity(data);

    }
View Full Code Here

  @Before
  public void before() {

    _calendarService = new CalendarServiceImpl();

    CalendarServiceData data = new CalendarServiceData();
    _calendarService.setData(data);

    addServiceDates(data, "sA", new ServiceDate(2010, 9, 10), new ServiceDate(
        2010, 9, 11));
    addServiceDates(data, "sB", new ServiceDate(2010, 9, 11), new ServiceDate(
View Full Code Here

  @PostConstruct
  @Refreshable(dependsOn = RefreshableResources.CALENDAR_DATA)
  public void setup() throws IOException, ClassNotFoundException {
    File path = _bundle.getCalendarServiceDataPath();
    if (path.exists()) {
      CalendarServiceData data = ObjectSerializationLibrary.readObject(path);
      setData(data);
    } else {
      setData(new CalendarServiceData());
    }
  }
View Full Code Here

    _stopId = _stop.getId();

    TransitGraphDao graph = Mockito.mock(TransitGraphDao.class);
    Mockito.when(graph.getStopEntryForId(_stop.getId(), true)).thenReturn(_stop);

    CalendarServiceData data = new CalendarServiceData();
    data.putDatesForLocalizedServiceId(lsid("sA"),
        Arrays.asList(date("2009-09-01 00:00"), date("2009-09-02 00:00")));
    data.putDatesForLocalizedServiceId(lsid("sB"),
        Arrays.asList(date("2009-09-03 00:00")));

    CalendarServiceImpl calendarService = new CalendarServiceImpl();
    calendarService.setData(data);
View Full Code Here

TOP

Related Classes of org.onebusaway.gtfs.model.calendar.CalendarServiceData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.