@Override public int compare(StopTime o1, StopTime o2) { Trip trip1 = o1.getTrip(); Trip trip2 = o2.getTrip(); int c = trip1.getId().compareTo(trip2.getId()); if (c == 0) c = o1.getStopSequence() - o2.getStopSequence(); return c; }
/** ** {@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; }