public class TimetableSnapshot extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
TimetableSnapshot.SortedTimetableComparator |
protected class |
TimetableSnapshot.TripIdAndServiceDate
Class to use as key in HashMap containing feed id, trip id and service date
|
Constructor and Description |
---|
TimetableSnapshot() |
Modifier and Type | Method and Description |
---|---|
void |
clear(String feedId)
Clear all data of snapshot for the provided feed id
|
protected boolean |
clearLastAddedTripPattern(String feedId)
Clear all last added trip patterns matching the provided feed id.
|
protected boolean |
clearTimetable(String feedId)
Clear timetable for all patterns matching the provided feed id.
|
TimetableSnapshot |
commit()
This produces a small delay of typically around 50ms, which is almost entirely due to
the indexing step.
|
TimetableSnapshot |
commit(boolean force) |
TripPattern |
getLastAddedTripPattern(String feedId,
String tripId,
org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate)
Get the last added trip pattern given a trip id (without agency) and a service date as
a result of a call to
update(String feedId, TripPattern, TripTimes, ServiceDate) with trip times of
a trip that didn't exist yet in the trip pattern. |
boolean |
isDirty() |
boolean |
purgeExpiredData(org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate)
Removes all Timetables which are valid for a ServiceDate on-or-before the one supplied.
|
Timetable |
resolve(TripPattern pattern,
org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate)
Returns an updated timetable for the specified pattern if one is available in this snapshot,
or the originally scheduled timetable if there are no updates in this snapshot.
|
String |
toString() |
boolean |
update(String feedId,
TripPattern pattern,
TripTimes updatedTripTimes,
org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate)
Update the trip times of one trip in a timetable of a trip pattern.
|
public Timetable resolve(TripPattern pattern, org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate)
public TripPattern getLastAddedTripPattern(String feedId, String tripId, org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate)
update(String feedId, TripPattern, TripTimes, ServiceDate)
with trip times of
a trip that didn't exist yet in the trip pattern.feedId
- feed id the trip id belongs totripId
- trip id (without agency)serviceDate
- service datepublic boolean update(String feedId, TripPattern pattern, TripTimes updatedTripTimes, org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate)
pattern
- trip patternupdatedTripTimes
- updated trip timesserviceDate
- service day for which this update is validpublic TimetableSnapshot commit()
public TimetableSnapshot commit(boolean force)
public void clear(String feedId)
feedId
- feed id to clear the snapshop forprotected boolean clearTimetable(String feedId)
feedId
- feed id to clear outprotected boolean clearLastAddedTripPattern(String feedId)
feedId
- feed id to clear outpublic boolean purgeExpiredData(org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate)
public boolean isDirty()
Copyright © 2018. All rights reserved.