private StopTime doMap(org.onebusaway.gtfs.model.StopTime rhs) { StopTime lhs = new StopTime(); lhs.setTrip(tripMapper.map(rhs.getTrip())); lhs.setStop(stopMapper.map(rhs.getStop())); lhs.setArrivalTime(rhs.getArrivalTime()); lhs.setDepartureTime(rhs.getDepartureTime()); lhs.setTimepoint(rhs.getTimepoint()); lhs.setStopSequence(rhs.getStopSequence()); lhs.setStopHeadsign(rhs.getStopHeadsign()); lhs.setRouteShortName(rhs.getRouteShortName()); lhs.setPickupType(rhs.getPickupType()); lhs.setDropOffType(rhs.getDropOffType()); lhs.setShapeDistTraveled(rhs.getShapeDistTraveled()); lhs.setFarePeriodId(rhs.getFarePeriodId()); // Skip mapping of proxy // private transient StopTimeProxy proxy; if (rhs.getProxy() != null) { throw new IllegalStateException("Did not expect proxy to be set!"); } return lhs; }
private List<StopTime> removeTimePoints(List<StopTime> stopTimes) { List<StopTime> results = new ArrayList<StopTime>(stopTimes.size()); for (StopTime st : stopTimes) { if (st.getDropOffType() == 1 && st.getPickupType() == 1) { // we have a timepoint -- silently drop } else { results.add(st); } } return results; }
private boolean isNonRevenue (StopTime s){ return (s.getDropOffType() ==1 && s.getPickupType() ==1); } }
private boolean isNonRevenue (StopTime s){ return (s.getDropOffType() ==1 && s.getPickupType() ==1); }
public static StopPattern stopPatternfromTrip(Trip trip, GtfsRelationalDao dao) { Vector<Stop> stops = new Vector<Stop>(); Vector<Boolean> pickups = new Vector<Boolean>(); Vector<Boolean> dropoffs = new Vector<Boolean>(); for (StopTime stoptime : dao.getStopTimesForTrip(trip)) { stops.add(stoptime.getStop()); pickups.add(stoptime.getPickupType() != 1); dropoffs.add(stoptime.getDropOffType() != 1); } StopPattern pattern = new StopPattern(stops, pickups, dropoffs, trip.getServiceId()); return pattern; }
perStopFlags[i] |= FLAG_WHEELCHAIR_ACCESSIBLE; if (stopTime.getPickupType() != 1) { perStopFlags[i] |= FLAG_PICKUP;
stopTimeEntry.setGtfsSequence(stopTime.getStopSequence()); stopTimeEntry.setDropOffType(stopTime.getDropOffType()); stopTimeEntry.setPickupType(stopTime.getPickupType()); stopTimeEntry.setStop(stopEntry);
private List<StopTimeEntryImpl> createInitialStopTimeEntries( TransitGraphImpl graph, List<StopTime> stopTimes) { List<StopTimeEntryImpl> stopTimeEntries = new ArrayList<StopTimeEntryImpl>(); int sequence = 0; for (StopTime stopTime : stopTimes) { Stop stop = stopTime.getStop(); AgencyAndId stopId = stop.getId(); StopEntryImpl stopEntry = graph.getStopEntryForId(stopId); StopTimeEntryImpl stopTimeEntry = new StopTimeEntryImpl(); stopTimeEntry.setId(stopTime.getId()); stopTimeEntry.setSequence(sequence); stopTimeEntry.setDropOffType(stopTime.getDropOffType()); stopTimeEntry.setPickupType(stopTime.getPickupType()); stopTimeEntry.setStop(stopEntry); stopTimeEntries.add(stopTimeEntry); sequence++; } return stopTimeEntries; }
private List<StopTimeEntryImpl> createInitialStopTimeEntries( TransitGraphImpl graph, List<StopTime> stopTimes) { List<StopTimeEntryImpl> stopTimeEntries = new ArrayList<StopTimeEntryImpl>( stopTimes.size()); int sequence = 0; for (StopTime stopTime : stopTimes) { Stop stop = stopTime.getStop(); AgencyAndId stopId = stop.getId(); StopEntryImpl stopEntry = graph.getStopEntryForId(stopId); StopTimeEntryImpl stopTimeEntry = new StopTimeEntryImpl(); stopTimeEntry.setId(stopTime.getId()); stopTimeEntry.setSequence(sequence); stopTimeEntry.setGtfsSequence(stopTime.getStopSequence()); stopTimeEntry.setDropOffType(stopTime.getDropOffType()); stopTimeEntry.setPickupType(stopTime.getPickupType()); stopTimeEntry.setStop(stopEntry); stopTimeEntries.add(stopTimeEntry); sequence++; } return stopTimeEntries; }
/**** * {@link Collection} Interface ****/ @Override public boolean add(StopTime stopTime) { int index = size; size++; ensureCapacity(size); trips[index] = stopTime.getTrip(); stops[index] = stopTime.getStop(); arrivalTimes[index] = stopTime.getArrivalTime(); departureTimes[index] = stopTime.getDepartureTime(); timepoints[index] = stopTime.getTimepoint(); stopSequences[index] = stopTime.getStopSequence(); stopHeadsigns[index] = stopTime.getStopHeadsign(); routeShortNames[index] = stopTime.getRouteShortName(); pickupTypes[index] = stopTime.getPickupType(); dropOffTypes[index] = stopTime.getDropOffType(); shapeDistTraveled[index] = stopTime.getShapeDistTraveled(); return true; }
/**** * {@link Collection} Interface ****/ @Override public boolean add(StopTime stopTime) { int index = size; size++; ensureCapacity(size); trips[index] = stopTime.getTrip(); stops[index] = stopTime.getStop(); arrivalTimes[index] = stopTime.getArrivalTime(); departureTimes[index] = stopTime.getDepartureTime(); timepoints[index] = stopTime.getTimepoint(); stopSequences[index] = stopTime.getStopSequence(); stopHeadsigns[index] = stopTime.getStopHeadsign(); routeShortNames[index] = stopTime.getRouteShortName(); pickupTypes[index] = stopTime.getPickupType(); dropOffTypes[index] = stopTime.getDropOffType(); shapeDistTraveled[index] = stopTime.getShapeDistTraveled(); return true; }
hops.add(hop); if (st0.getPickupType() != 1) { Board boarding = new Board(startStation, startJourneyDepart, hop, tripWheelchairAccessible && s0.getWheelchairBoarding() != 0);
private StopTime cloneStopTime(StopTime original) { StopTime anew = new StopTime(); anew.setTrip(original.getTrip()); anew.setStopSequence(original.getStopSequence()); anew.setStopHeadsign(original.getStopHeadsign()); anew.setStop(original.getStop()); anew.setRouteShortName(original.getRouteShortName()); anew.setPickupType(original.getPickupType()); anew.setId(original.getId()); anew.setDropOffType(original.getDropOffType()); if(original.isShapeDistTraveledSet()) anew.setShapeDistTraveled(original.getShapeDistTraveled()); if(original.isArrivalTimeSet()) anew.setArrivalTime(original.getArrivalTime()); if(original.isDepartureTimeSet()) anew.setDepartureTime(original.getDepartureTime()); return anew; } }