public class TripTimes extends Object implements Serializable, Comparable<TripTimes>, Cloneable
Modifier and Type | Field and Description |
---|---|
int |
serviceCode
The code for the service on which this trip runs.
|
org.onebusaway.gtfs.model.Trip |
trip
The trips whose arrivals and departures are represented by this TripTimes
|
static int |
UNAVAILABLE
This constant is used for indicating passed stops, fully canceled trips and trips that are
otherwise unavailable during routing.
|
Constructor and Description |
---|
TripTimes(org.onebusaway.gtfs.model.Trip trip,
List<org.onebusaway.gtfs.model.StopTime> stopTimes,
Deduplicator deduplicator)
The provided stopTimes are assumed to be pre-filtered, valid, and monotonically increasing.
|
TripTimes(TripTimes object)
This copy constructor does not copy the actual times, only the scheduled times.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel this entire trip
|
TripTimes |
clone() |
int |
compareTo(TripTimes other)
Sort TripTimes based on first departure time.
|
static String |
formatSeconds(int s)
Used in debugging / dumping times.
|
int |
getArrivalDelay(int stop) |
int |
getArrivalTime(int stop) |
int |
getDepartureDelay(int stop) |
int |
getDepartureTime(int stop) |
int |
getDwellTime(int stop) |
String |
getHeadsign(int stop)
Trips may also have null headsigns, in which case we should fall back on a Timetable or
Pattern-level headsign.
|
int |
getNumStops() |
RealTimeState |
getRealTimeState() |
int |
getRunningTime(int stop) |
int |
getScheduledArrivalTime(int stop) |
int |
getScheduledDepartureTime(int stop) |
int |
getStopSequence(int stop)
Just to create uniform getter-syntax across the whole public interface of TripTimes.
|
boolean |
isCanceled() |
boolean |
isScheduled() |
boolean |
isTimepoint(int stopIndex) |
com.google.common.hash.HashCode |
semanticHash(com.google.common.hash.HashFunction hashFunction)
Hash the scheduled arrival/departure times.
|
void |
setRealTimeState(RealTimeState realTimeState) |
TripTimes |
timeShift(int stop,
int time,
boolean depart)
Returns a time-shifted copy of this TripTimes in which the vehicle passes the given stop
index (not stop sequence number) at the given time.
|
boolean |
timesIncreasing()
When creating a scheduled TripTimes or wrapping it in updates, we could potentially imply
negative running or dwell times.
|
boolean |
tripAcceptable(State state0,
int stopIndex)
Once a trip has been found departing or arriving at an appropriate time, check whether that
trip fits other restrictive search criteria such as bicycle and wheelchair accessibility
and transfers with minimum time or forbidden transfers.
|
void |
updateArrivalDelay(int stop,
int delay) |
void |
updateArrivalTime(int stop,
int time) |
void |
updateDepartureDelay(int stop,
int delay) |
void |
updateDepartureTime(int stop,
int time) |
public static final int UNAVAILABLE
public final org.onebusaway.gtfs.model.Trip trip
public int serviceCode
public TripTimes(org.onebusaway.gtfs.model.Trip trip, List<org.onebusaway.gtfs.model.StopTime> stopTimes, Deduplicator deduplicator)
public TripTimes(TripTimes object)
public String getHeadsign(int stop)
public int getScheduledArrivalTime(int stop)
public int getScheduledDepartureTime(int stop)
public int getArrivalTime(int stop)
public int getDepartureTime(int stop)
public int getDwellTime(int stop)
public int getRunningTime(int stop)
public int getArrivalDelay(int stop)
public int getDepartureDelay(int stop)
public boolean isScheduled()
getRealTimeState()
in that it checks whether real-time
information is actually available in this TripTimes.public boolean isCanceled()
public RealTimeState getRealTimeState()
public void setRealTimeState(RealTimeState realTimeState)
public static String formatSeconds(int s)
public boolean timesIncreasing()
public boolean tripAcceptable(State state0, int stopIndex)
public void cancel()
public void updateDepartureTime(int stop, int time)
public void updateDepartureDelay(int stop, int delay)
public void updateArrivalTime(int stop, int time)
public void updateArrivalDelay(int stop, int delay)
public int getNumStops()
public int compareTo(TripTimes other)
compareTo
in interface Comparable<TripTimes>
public TripTimes timeShift(int stop, int time, boolean depart)
public int getStopSequence(int stop)
public boolean isTimepoint(int stopIndex)
public com.google.common.hash.HashCode semanticHash(com.google.common.hash.HashFunction hashFunction)
Copyright © 2018. All rights reserved.