@Entity
public class TripPattern
extends java.lang.Object
implements java.io.Serializable, org.hibernate.classic.Lifecycle
Modifier and Type | Field and Description |
---|---|
static int |
TRIP_PATTERN_ID_LENGTH |
Constructor and Description |
---|
TripPattern(int configRev,
java.lang.String shapeId,
java.util.List<StopPath> stopPaths,
Trip trip,
GtfsData gtfsData)
Create a TripPattern.
|
Modifier and Type | Method and Description |
---|---|
void |
addTrip(Trip trip)
When processing a new trip let the TripPattern know that
this additional Trip refers to it.
|
static int |
deleteFromRev(org.hibernate.Session session,
int configRev)
Deletes rev from the TripPattern_to_Path_joinTable, StopPaths,
and TripPatterns tables.
|
boolean |
equals(java.lang.Object obj) |
int |
getConfigRev() |
java.lang.String |
getDirectionId()
Optional element direction_id specified in trips.txt GTFS file.
|
Extent |
getExtent()
The extent of all of the stops that make up the trip pattern
|
java.lang.String |
getHeadsign()
Usually from the trip_headsign from the trips.txt file
|
java.lang.String |
getId() |
double |
getLength()
Returns length of the trip from the first terminal to the last.
|
int |
getNumberStopPaths()
Returns the number of stopPaths/stops configured.
|
java.lang.String |
getRouteId() |
java.lang.String |
getRouteShortName() |
java.lang.String |
getShapeId() |
java.lang.String |
getStopId(int i)
Gets the stopId of the specified stop
|
java.util.List<java.lang.String> |
getStopIds()
Returns list of stop IDs for the stop paths for this trip pattern.
|
java.lang.String |
getStopName(int i)
Gets the name of the specified stop as obtained by a Core predictor.
|
StopPath |
getStopPath(int index) |
StopPath |
getStopPath(java.lang.String stopId)
Returns the StopPath for this TripPattern as specified by the stopId
parameter.
|
java.lang.String |
getStopPathId(int i)
Gets the pathId of the specified stop
|
java.util.List<StopPath> |
getStopPaths() |
static java.util.List<TripPattern> |
getTripPatterns(org.hibernate.Session session,
int configRev)
Returns list of TripPattern objects for the specified configRev
|
java.util.List<Trip> |
getTrips()
NOTE: the Trip List is not available when the object has been read from the
database.
|
int |
hashCode() |
boolean |
isStopAtOrAfterStop(java.lang.String stopId1,
java.lang.String stopId2)
Returns true if for this TripPattern that stopId2 is after stopId1.
|
boolean |
onDelete(org.hibernate.Session arg0) |
void |
onLoad(org.hibernate.Session arg0,
java.io.Serializable arg1) |
boolean |
onSave(org.hibernate.Session arg0) |
boolean |
onUpdate(org.hibernate.Session arg0) |
boolean |
servesStop(java.lang.String stopId)
Returns true if this trip pattern includes the specified stopId.
|
java.lang.String |
toShortString()
For when don't want to display the entire contents of TripPattern,
which can be pretty large because contains list of stops and trips.
|
java.lang.String |
toString() |
java.lang.String |
toStringListingTripIds()
A short version of the Trip string.
|
public static final int TRIP_PATTERN_ID_LENGTH
public TripPattern(int configRev, java.lang.String shapeId, java.util.List<StopPath> stopPaths, Trip trip, GtfsData gtfsData)
configRev
- shapeId
- Part of what identifies the trip patternstopPaths
- Part of what identifies the trip patterntrip
- For supplying additional infogtfsData
- So can access stop data for determining extent of trip
pattern.public static int deleteFromRev(org.hibernate.Session session, int configRev) throws org.hibernate.HibernateException
session
- configRev
- org.hibernate.HibernateException
public static java.util.List<TripPattern> getTripPatterns(org.hibernate.Session session, int configRev) throws org.hibernate.HibernateException
session
- configRev
- org.hibernate.HibernateException
public void addTrip(Trip trip)
gtfsTrip
- public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toShortString()
public java.lang.String toStringListingTripIds()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean servesStop(java.lang.String stopId)
stopId
- public StopPath getStopPath(java.lang.String stopId)
stopId
- public boolean isStopAtOrAfterStop(java.lang.String stopId1, java.lang.String stopId2)
stopId1
- stopId2
- public int getConfigRev()
public java.util.List<StopPath> getStopPaths()
public java.util.List<java.lang.String> getStopIds()
public double getLength()
public StopPath getStopPath(int index)
index
- public int getNumberStopPaths()
public java.lang.String getStopId(int i)
i
- public java.lang.String getStopName(int i)
i
- public java.lang.String getStopPathId(int i)
i
- public java.lang.String getShapeId()
public java.lang.String getId()
public java.lang.String getRouteId()
public java.lang.String getRouteShortName()
public java.lang.String getHeadsign()
public java.lang.String getDirectionId()
public java.util.List<Trip> getTrips()
public Extent getExtent()
public boolean onDelete(org.hibernate.Session arg0) throws org.hibernate.CallbackException
onDelete
in interface org.hibernate.classic.Lifecycle
org.hibernate.CallbackException
public void onLoad(org.hibernate.Session arg0, java.io.Serializable arg1)
onLoad
in interface org.hibernate.classic.Lifecycle
public boolean onSave(org.hibernate.Session arg0) throws org.hibernate.CallbackException
onSave
in interface org.hibernate.classic.Lifecycle
org.hibernate.CallbackException
public boolean onUpdate(org.hibernate.Session arg0) throws org.hibernate.CallbackException
onUpdate
in interface org.hibernate.classic.Lifecycle
org.hibernate.CallbackException