public class IpcPredictionsForRouteStopDest
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
IpcPredictionsForRouteStopDest(java.lang.String routeShortName,
java.lang.String stopId,
java.lang.String directionId,
double distanceToStop)
For constructing IpcPredictionsForRouteStopDest object when there are no
current predictions.
|
IpcPredictionsForRouteStopDest(TripPattern tripPattern,
java.lang.String stopId,
double distanceToStop)
For constructing an IpcPredictionsForRouteStopDest for when there aren't
any predictions.
|
IpcPredictionsForRouteStopDest(Trip trip,
java.lang.String stopId,
double distanceToStop)
Constructor for creating a IpcPredictionsForRouteStopDest on the server
side.
|
Modifier and Type | Method and Description |
---|---|
IpcPredictionsForRouteStopDest |
getClone(int maxPredictionsPerStop,
double distanceToStop)
Gets a copy of this object.
|
IpcPredictionsForRouteStopDest |
getClone(int maxPredictionsPerStop,
long maxSystemTimeForPrediction,
double distanceToStop)
Gets a copy of this object.
|
java.lang.String |
getDirectionId() |
double |
getDistanceToStop()
Distance from location to the stop if getting predictions
by location.
|
java.lang.String |
getHeadsign() |
java.util.List<IpcPrediction> |
getPredictionsForRouteStop() |
java.lang.String |
getRouteId() |
java.lang.String |
getRouteName() |
int |
getRouteOrder() |
java.lang.String |
getRouteShortName() |
java.lang.String |
getStopId() |
java.lang.String |
getStopName() |
void |
removeExpiredPredictions(long currentTime)
Removes predictions that are older than the current time.
|
void |
removePrediction(IpcPrediction oldPrediction)
Removes a prediction.
|
java.lang.String |
toShortString()
Intended for debugging
|
java.lang.String |
toString() |
void |
updatePredictionsForVehicle(java.util.List<IpcPrediction> newPredsForRouteStopDest,
long currentTime)
Updates the predictions for this object with the new predictions for a
vehicle.
|
public IpcPredictionsForRouteStopDest(Trip trip, java.lang.String stopId, double distanceToStop)
trip
- stopId
- distanceToStop
- How far stop is away from user. If predictions are not
location based then use value of Double.NaN.public IpcPredictionsForRouteStopDest(TripPattern tripPattern, java.lang.String stopId, double distanceToStop)
tripPattern
- Must not be nullstopId
- distanceToStop
- public IpcPredictionsForRouteStopDest(java.lang.String routeShortName, java.lang.String stopId, java.lang.String directionId, double distanceToStop)
routeShortName
- stopId
- directionId
- distanceToStop
- public IpcPredictionsForRouteStopDest getClone(int maxPredictionsPerStop, double distanceToStop)
maxPredictionsPerStop
- distanceFromStop
- For when getting predictions by locationpublic IpcPredictionsForRouteStopDest getClone(int maxPredictionsPerStop, long maxSystemTimeForPrediction, double distanceToStop)
maxPredictionsPerStop
- Won't copy more then this number of predictionsmaxSystemTimeForPrediction
- Max point in future want predictions for. This way can limit
predictions when requesting a large number of them.distanceToStop
- For when getting predictions by locationpublic void removePrediction(IpcPrediction oldPrediction)
Not sure if really need to synchronize removal of predictions from list since it is only a single operation. But synching it is certainly the safe thing to do.
oldPrediction
- public void removeExpiredPredictions(long currentTime)
currentTime
- Should use PredictionDataCache.systemTime.get() so that works
even when in playback mode.public void updatePredictionsForVehicle(java.util.List<IpcPrediction> newPredsForRouteStopDest, long currentTime)
Synchronized because there are multiple steps in removing old predictions and creating new ones.
newPredsForRouteStopDest
- The new predictions for the vehiclecurrentTime
- So can get rid of predictions that have expired.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toShortString()
public java.lang.String getRouteId()
public java.lang.String getRouteShortName()
public java.lang.String getRouteName()
public java.lang.String getStopId()
public java.lang.String getStopName()
public java.lang.String getHeadsign()
public java.lang.String getDirectionId()
public double getDistanceToStop()
public java.util.List<IpcPrediction> getPredictionsForRouteStop()
public int getRouteOrder()