@Override public TransitSchedule createTransitSchedule() { return new TransitScheduleImpl(this); }
@Override public Departure createDeparture(final Id<Departure> departureId, final double time) { return new DepartureImpl(departureId, time); }
@Override public TransitStopFacility createTransitStopFacility(final Id<TransitStopFacility> facilityId, final Coord coordinate, final boolean blocksLane) { return new TransitStopFacilityImpl(facilityId, coordinate, blocksLane); }
@Test public void testRemoveTransitLine() { TransitSchedule schedule = new TransitScheduleImpl(new TransitScheduleFactoryImpl()); TransitLine line1 = new TransitLineImpl(Id.create(1, TransitLine.class)); TransitLine line1b = new TransitLineImpl(Id.create(1, TransitLine.class)); schedule.addTransitLine(line1); Assert.assertFalse(schedule.removeTransitLine(line1b)); Assert.assertTrue(schedule.removeTransitLine(line1)); Assert.assertFalse(schedule.removeTransitLine(line1)); }
@Test public void testInitialization() { TransitScheduleFactory builder = new TransitScheduleFactoryImpl(); TransitSchedule schedule = new TransitScheduleImpl(builder); assertEquals(builder, schedule.getFactory()); }
public void testDescription() { Fixture f = new Fixture(); assertNull(f.tRoute.getDescription()); String desc = "some random description string."; f.tRoute.setDescription(desc); assertEquals(desc, f.tRoute.getDescription()); desc += " [updated]"; f.tRoute.setDescription(desc); assertEquals(desc, f.tRoute.getDescription()); }
public void testTransportMode() { Fixture f = new Fixture(); // test default of Fixture assertEquals("train", f.tRoute.getTransportMode()); // test some different from default f.tRoute.setTransportMode("tram"); assertEquals("tram", f.tRoute.getTransportMode()); }
protected TransitScheduleFactory createTransitScheduleBuilder() { return new TransitScheduleFactoryImpl(); }
@Override public TransitLine createTransitLine(final Id<TransitLine> lineId) { return new TransitLineImpl(lineId); }
@Override public TransitRoute createTransitRoute(final Id<TransitRoute> routeId, final NetworkRoute route, final List<TransitRouteStop> stops, final String mode) { return new TransitRouteImpl(routeId, route, stops, mode); }
@Override public TransitRouteStop createTransitRouteStop(final TransitStopFacility stop, final double arrivalDelay, final double departureDelay) { return new TransitRouteStopImpl(stop, arrivalDelay, departureDelay); }
public void write(OutputStream stream) throws UncheckedIOException { this.openOutputStream(stream); try { writeData(); } catch (IOException e) { throw new UncheckedIOException(e); } }
@Override public MinimalTransferTimesIterator iterator() { return new MinimalTransferTimesIteratorImpl(this.minimalTransferTimes); }
@Override public double get(Id<TransitStopFacility> fromStop, Id<TransitStopFacility> toStop) { return get(fromStop, toStop, Double.NaN); }
/** * In case we once should have more than one implementation of * {@link Departure}, simply inherit from this test and overwrite * this method to return your own implementation. * * @param id * @param time * @return a new instance of a Departure with the given attributes */ protected Departure createDeparture(final Id<Departure> id, final double time) { return new DepartureImpl(id, time); }
/** * In case we once should have more than one implementation of * {@link TransitStopFacility}, simply inherit from this test and overwrite * this method to return your own implementation. * * @param id * @param coord * @return a new instance of a TransitStopFacility with the given attributes */ protected TransitStopFacility createTransitStopFacility(final Id<TransitStopFacility> id, final Coord coord, final boolean isBlockingLane) { return new TransitStopFacilityImpl(id, coord, isBlockingLane); }
/** * In case we once should have more than one implementation of * {@link TransitLine}, simply inherit from this test and overwrite * this method to return your own implementation. * * @param id * @return a new instance of a TransitLine with the given Id set */ protected TransitLine createTransitLine(final Id<TransitLine> id) { return new TransitLineImpl(id); }
/** * In case we once should have more than one implementation of * {@link TransitRoute}, simply inherit from this test and overwrite * this method to return your own implementation. * * @param id * @param route * @param stops * @param mode * @return a new instance of a TransitRoute with the given attributes */ protected static TransitRoute createTransitRoute(final Id<TransitRoute> id, final NetworkRoute route, final List<TransitRouteStop> stops, final String mode) { return new TransitRouteImpl(id, route, stops, mode); }
protected TransitRouteStop createTransitRouteStop(final TransitStopFacility stop, final double arrivalDelay, final double departureDelay) { return new TransitRouteStopImpl(stop, arrivalDelay, departureDelay); }