org.onebusaway.transit_data.model.blocks
Class BlockStatusBean

java.lang.Object
  extended by org.onebusaway.transit_data.model.blocks.BlockStatusBean
All Implemented Interfaces:
Serializable

public final class BlockStatusBean
extends Object
implements Serializable

Status of a particular block instance, including real-time location information when available.

Author:
bdferris
See Also:
BlockDetailsBean, Serialized Form

Constructor Summary
BlockStatusBean()
           
 
Method Summary
 double computeBestDistanceAlongBlock()
           
 BlockTripBean getActiveTrip()
           
 BlockBean getBlock()
           
 StopBean getClosestStop()
           
 int getClosestStopTimeOffset()
          The time offset, in seconds, from the closest stop to the current position of the transit vehicle among the stop times of the current block.
 double getDistanceAlongBlock()
          The vehicle's distance along the block.
 long getLastUpdateTime()
           
 CoordinatePoint getLocation()
           
 double getScheduledDistanceAlongBlock()
          The vehicle's scheduled distance along the block.
 double getScheduleDeviation()
           
 long getServiceDate()
           
 String getStatus()
           
 double getTotalDistanceAlongBlock()
           
 String getVehicleId()
           
 boolean isDistanceAlongBlockSet()
           
 boolean isInService()
           
 boolean isPredicted()
           
 boolean isScheduleDeviationSet()
           
 void setActiveTrip(BlockTripBean activeTrip)
           
 void setBlock(BlockBean block)
           
 void setClosestStop(StopBean closestStop)
           
 void setClosestStopTimeOffset(int closestStopTimeOffset)
          See description in getClosestStopTimeOffset().
 void setDistanceAlongBlock(double distanceAlongBlock)
          See description in getDistanceAlongBlock().
 void setInService(boolean inService)
           
 void setLastUpdateTime(long lastUpdateTime)
           
 void setLocation(CoordinatePoint location)
           
 void setPredicted(boolean predicted)
           
 void setScheduledDistanceAlongBlock(double scheduledDistanceAlongBlock)
           
 void setScheduleDeviation(double scheduleDeviation)
           
 void setServiceDate(long serviceDate)
           
 void setStatus(String status)
           
 void setTotalDistanceAlongBlock(double totalDistanceAlongBlock)
           
 void setVehicleId(String vehicleId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockStatusBean

public BlockStatusBean()
Method Detail

getBlock

public BlockBean getBlock()

setBlock

public void setBlock(BlockBean block)

getServiceDate

public long getServiceDate()

setServiceDate

public void setServiceDate(long serviceDate)

getScheduledDistanceAlongBlock

public double getScheduledDistanceAlongBlock()
The vehicle's scheduled distance along the block.

Returns:
distance, in meters

setScheduledDistanceAlongBlock

public void setScheduledDistanceAlongBlock(double scheduledDistanceAlongBlock)

getTotalDistanceAlongBlock

public double getTotalDistanceAlongBlock()

setTotalDistanceAlongBlock

public void setTotalDistanceAlongBlock(double totalDistanceAlongBlock)

isInService

public boolean isInService()

setInService

public void setInService(boolean inService)

getStatus

public String getStatus()

setStatus

public void setStatus(String status)

getLocation

public CoordinatePoint getLocation()

setLocation

public void setLocation(CoordinatePoint location)

getActiveTrip

public BlockTripBean getActiveTrip()

setActiveTrip

public void setActiveTrip(BlockTripBean activeTrip)

getClosestStop

public StopBean getClosestStop()

setClosestStop

public void setClosestStop(StopBean closestStop)

getClosestStopTimeOffset

public int getClosestStopTimeOffset()
The time offset, in seconds, from the closest stop to the current position of the transit vehicle among the stop times of the current block. If the number is positive, the stop is coming up. If negative, the stop has already been passed.

Returns:
time, in seconds

setClosestStopTimeOffset

public void setClosestStopTimeOffset(int closestStopTimeOffset)
See description in getClosestStopTimeOffset().

Parameters:
closestStopTimeOffset - the time offset from the closest stop, in seconds

isPredicted

public boolean isPredicted()

setPredicted

public void setPredicted(boolean predicted)

setLastUpdateTime

public void setLastUpdateTime(long lastUpdateTime)

getLastUpdateTime

public long getLastUpdateTime()
Returns:
the time we last heard from the bus (Unix-time)

isScheduleDeviationSet

public boolean isScheduleDeviationSet()

getScheduleDeviation

public double getScheduleDeviation()

setScheduleDeviation

public void setScheduleDeviation(double scheduleDeviation)

isDistanceAlongBlockSet

public boolean isDistanceAlongBlockSet()
Returns:
true if getDistanceAlongBlock() has been set

getDistanceAlongBlock

public double getDistanceAlongBlock()
The vehicle's distance along the block.

Returns:
distance, in meters

setDistanceAlongBlock

public void setDistanceAlongBlock(double distanceAlongBlock)
See description in getDistanceAlongBlock().

Parameters:
distanceAlongBlock -

getVehicleId

public String getVehicleId()

setVehicleId

public void setVehicleId(String vehicleId)

computeBestDistanceAlongBlock

public double computeBestDistanceAlongBlock()


Copyright © 2012 OneBusAway. All Rights Reserved.