@Entity
public class TravelTimesForTrip
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
TravelTimesForTrip(int configRev,
int travelTimesRev,
Trip trip)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(TravelTimesForStopPath travelTimesForPath)
For when creating a new TravelTimesForTrip.
|
static int |
deleteFromRev(org.hibernate.Session session,
int configRev)
Deletes data from the TravelTimesForTrip and the
TravelTimesForTrip_to_TravelTimesForPath_jointable.
|
boolean |
equals(java.lang.Object obj)
Needed because of Hibernate and also because want to cache
TravelTimesForTrip and to do so need to store the objects
as keys in a map and need hashCode() and equals() for doing
that properly.
|
int |
getConfigRev()
Getter Methods
|
int |
getTravelTimeRev() |
TravelTimesForStopPath |
getTravelTimesForStopPath(int index) |
java.util.List<TravelTimesForStopPath> |
getTravelTimesForStopPaths() |
static java.util.Map<java.lang.String,java.util.List<TravelTimesForTrip>> |
getTravelTimesForTrips(org.hibernate.Session session,
int travelTimesRev)
Returns Map keyed by tripPatternId of Lists of TravelTimesForTrip.
|
java.lang.String |
getTripCreatedForId() |
java.lang.String |
getTripPatternId() |
int |
hashCode()
Needed because of Hibernate and also because want to cache
TravelTimesForTrip and to do so need to store the objects
as keys in a map and need hashCode() and equals() for doing
that properly.
|
int |
numberOfStopPaths() |
boolean |
purelyScheduleBased()
Returns true if every single stop path travel time is schedule based.
|
java.lang.String |
toString() |
java.lang.String |
toStringWithNewlines()
Similar to toString() but puts each travelTimesForStopPath on a separate
line to try to make the output more readable.
|
public TravelTimesForTrip(int configRev, int travelTimesRev, Trip trip)
configRev
- travelTimesRev
- trip
- So can determine trip pattern ID and set which trip this was
created for.public void add(TravelTimesForStopPath travelTimesForPath)
travelTimesForPath
- public static int deleteFromRev(org.hibernate.Session session, int configRev) throws org.hibernate.HibernateException
session
- configRev
- org.hibernate.HibernateException
public static java.util.Map<java.lang.String,java.util.List<TravelTimesForTrip>> getTravelTimesForTrips(org.hibernate.Session session, int travelTimesRev) throws org.hibernate.HibernateException
session
- travelTimesRev
- org.hibernate.HibernateException
public boolean purelyScheduleBased()
public int hashCode()
Note that not comparing tripCreatedForId. This is VERY IMPORTANT because when caching TravelTimesForTrip don't need to the tripCreatedForId to match. This is the only way that can used cached values for other trips when processing historic travel data.
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
Note that not comparing tripCreatedForId. This is VERY IMPORTANT because when caching TravelTimesForTrip don't need to the tripCreatedForId to match. This is the only way that can used cached values for other trips when processing historic travel data.
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringWithNewlines()
public int getConfigRev()
public int getTravelTimeRev()
public java.lang.String getTripPatternId()
public java.lang.String getTripCreatedForId()
public java.util.List<TravelTimesForStopPath> getTravelTimesForStopPaths()
public TravelTimesForStopPath getTravelTimesForStopPath(int index)
public int numberOfStopPaths()