org.onebusaway.realtime.api
Class VehicleLocationRecord
java.lang.Object
org.onebusaway.realtime.api.VehicleLocationRecord
- All Implemented Interfaces:
- Serializable
public class VehicleLocationRecord
- extends Object
- implements Serializable
Vehicle location records are the key data structure for passing real-time
location data about a transit vehicle from an external data source into
OneBusAway. It tries to capture a variety of fields that might be present in
an AVL stream:
- block id
- trip id
- vehicle id
- location
- schedule adherence
- arrival data relative to a timepoint
Not all of these fields will necessarily be set by the AVL source, so we may
have to be flexible in how we process the data.
- Author:
- bdferris
- See Also:
VehicleLocationListener
,
Serialized Form
VehicleLocationRecord
public VehicleLocationRecord()
VehicleLocationRecord
public VehicleLocationRecord(VehicleLocationRecord r)
getServiceDate
public long getServiceDate()
setServiceDate
public void setServiceDate(long serviceDate)
getBlockId
public org.onebusaway.gtfs.model.AgencyAndId getBlockId()
setBlockId
public void setBlockId(org.onebusaway.gtfs.model.AgencyAndId blockId)
getTripId
public org.onebusaway.gtfs.model.AgencyAndId getTripId()
setTripId
public void setTripId(org.onebusaway.gtfs.model.AgencyAndId tripId)
getVehicleId
public org.onebusaway.gtfs.model.AgencyAndId getVehicleId()
setVehicleId
public void setVehicleId(org.onebusaway.gtfs.model.AgencyAndId vehicleId)
getTimeOfRecord
public long getTimeOfRecord()
- Returns:
- time when the vehicle location record was made, in unix-time (ms)
setTimeOfRecord
public void setTimeOfRecord(long timeOfRecord)
- Parameters:
timeOfRecord
- time when the vehicle location record was made, in
unix-time (ms)
getTimeOfLocationUpdate
public long getTimeOfLocationUpdate()
- Returns:
- time when the last vehicle location update made, in unix-time (ms)
setTimeOfLocationUpdate
public void setTimeOfLocationUpdate(long timeOfLocationUpdate)
isScheduleDeviationSet
public boolean isScheduleDeviationSet()
- Returns:
- true if schedule deviation information has been provided
getScheduleDeviation
public double getScheduleDeviation()
- Returns:
- schedule deviation, in seconds, (+deviation is late, -deviation is
early)
setScheduleDeviation
public void setScheduleDeviation(double scheduleDeviation)
- Parameters:
scheduleDeviation
- - in seconds (+deviation is late, -deviation is
early)
isDistanceAlongBlockSet
public boolean isDistanceAlongBlockSet()
getDistanceAlongBlock
public double getDistanceAlongBlock()
- Returns:
- the distance traveled along the block in meters, or NaN if not set
setDistanceAlongBlock
public void setDistanceAlongBlock(double distanceAlongBlock)
- Parameters:
distanceAlongBlock
- distance traveled along the block in meters, or
NaN if not set
isCurrentLocationSet
public boolean isCurrentLocationSet()
getCurrentLocationLat
public double getCurrentLocationLat()
setCurrentLocationLat
public void setCurrentLocationLat(double currentLocationLat)
getCurrentLocationLon
public double getCurrentLocationLon()
setCurrentLocationLon
public void setCurrentLocationLon(double currentLocationLon)
isCurrentOrientationSet
public boolean isCurrentOrientationSet()
getCurrentOrientation
public double getCurrentOrientation()
- In degrees, 0º is East, 90º is North, 180º is West, and 270º is South
setCurrentOrientation
public void setCurrentOrientation(double currentOrientation)
getTimepointPredictions
public List<TimepointPredictionRecord> getTimepointPredictions()
setTimepointPredictions
public void setTimepointPredictions(List<TimepointPredictionRecord> timepointPredictions)
getPhase
public EVehiclePhase getPhase()
setPhase
public void setPhase(EVehiclePhase phase)
getStatus
public String getStatus()
setStatus
public void setStatus(String status)
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2012 OneBusAway. All Rights Reserved.