org.onebusaway.realtime.api
Class VehicleLocationRecord

java.lang.Object
  extended by 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:

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

Constructor Summary
VehicleLocationRecord()
           
VehicleLocationRecord(VehicleLocationRecord r)
           
 
Method Summary
 org.onebusaway.gtfs.model.AgencyAndId getBlockId()
           
 double getCurrentLocationLat()
           
 double getCurrentLocationLon()
           
 double getCurrentOrientation()
          In degrees, 0º is East, 90º is North, 180º is West, and 270º is South
 double getDistanceAlongBlock()
           
 EVehiclePhase getPhase()
           
 double getScheduleDeviation()
           
 long getServiceDate()
           
 String getStatus()
           
 long getTimeOfLocationUpdate()
           
 long getTimeOfRecord()
           
 List<TimepointPredictionRecord> getTimepointPredictions()
           
 org.onebusaway.gtfs.model.AgencyAndId getTripId()
           
 org.onebusaway.gtfs.model.AgencyAndId getVehicleId()
           
 boolean isCurrentLocationSet()
           
 boolean isCurrentOrientationSet()
           
 boolean isDistanceAlongBlockSet()
           
 boolean isScheduleDeviationSet()
           
 void setBlockId(org.onebusaway.gtfs.model.AgencyAndId blockId)
           
 void setCurrentLocationLat(double currentLocationLat)
           
 void setCurrentLocationLon(double currentLocationLon)
           
 void setCurrentOrientation(double currentOrientation)
           
 void setDistanceAlongBlock(double distanceAlongBlock)
           
 void setPhase(EVehiclePhase phase)
           
 void setScheduleDeviation(double scheduleDeviation)
           
 void setServiceDate(long serviceDate)
           
 void setStatus(String status)
           
 void setTimeOfLocationUpdate(long timeOfLocationUpdate)
           
 void setTimeOfRecord(long timeOfRecord)
           
 void setTimepointPredictions(List<TimepointPredictionRecord> timepointPredictions)
           
 void setTripId(org.onebusaway.gtfs.model.AgencyAndId tripId)
           
 void setVehicleId(org.onebusaway.gtfs.model.AgencyAndId vehicleId)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VehicleLocationRecord

public VehicleLocationRecord()

VehicleLocationRecord

public VehicleLocationRecord(VehicleLocationRecord r)
Method Detail

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.