org.onebusaway.transit_data_federation.impl.realtime
Class BlockLocationRecordCollection

java.lang.Object
  extended by org.onebusaway.transit_data_federation.impl.realtime.BlockLocationRecordCollection
All Implemented Interfaces:
Serializable

public final class BlockLocationRecordCollection
extends Object
implements Serializable

A collection of block location records from the same block/trip/vehicle over a time range, designed to maintain a cache of recent records and easily interpolate location and schedule deviations from specific timestamps

Author:
bdferris
See Also:
Serialized Form

Constructor Summary
BlockLocationRecordCollection(long fromTime, long toTime)
           
BlockLocationRecordCollection(long fromTime, long toTime, SortedMap<Long,BlockLocationRecord> records)
           
 
Method Summary
 BlockLocationRecordCollection addRecord(BlockInstance blockInstance, BlockLocationRecord record, long windowSize)
           
static BlockLocationRecordCollection createFromRecords(BlockInstance blockInstance, List<BlockLocationRecord> records)
          Convenience method that creates a link BlockLocationRecordCollection from a list of records
 BlockInstance getBlockInstance()
           
 double getDistanceAlongBlockForTargetTime(long targetTime)
           
 long getFromTime()
           
 CoordinatePoint getLastLocationForTargetTime(long targetTime)
           
 double getLastOrientationForTargetTime(long targetTime)
           
 long getLastUpdateTime(long targetTime)
           
 long getMeasuredLastUpdateTime()
           
 EVehiclePhase getPhaseForTargetTime(long targetTime)
           
 double getScheduleDeviationForTargetTime(long targetTime)
           
 String getStatusForTargetTime(long targetTime)
           
 long getToTime()
           
 org.onebusaway.gtfs.model.AgencyAndId getVehicleId()
           
 boolean isEmpty()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockLocationRecordCollection

public BlockLocationRecordCollection(long fromTime,
                                     long toTime,
                                     SortedMap<Long,BlockLocationRecord> records)

BlockLocationRecordCollection

public BlockLocationRecordCollection(long fromTime,
                                     long toTime)
Method Detail

createFromRecords

public static BlockLocationRecordCollection createFromRecords(BlockInstance blockInstance,
                                                              List<BlockLocationRecord> records)
Convenience method that creates a link BlockLocationRecordCollection from a list of records

Parameters:
records -
Returns:
a collection instance from the specified records

getBlockInstance

public BlockInstance getBlockInstance()

getVehicleId

public org.onebusaway.gtfs.model.AgencyAndId getVehicleId()

getFromTime

public long getFromTime()

getToTime

public long getToTime()

getMeasuredLastUpdateTime

public long getMeasuredLastUpdateTime()

isEmpty

public boolean isEmpty()

getScheduleDeviationForTargetTime

public double getScheduleDeviationForTargetTime(long targetTime)

getDistanceAlongBlockForTargetTime

public double getDistanceAlongBlockForTargetTime(long targetTime)

getLastLocationForTargetTime

public CoordinatePoint getLastLocationForTargetTime(long targetTime)

getLastOrientationForTargetTime

public double getLastOrientationForTargetTime(long targetTime)

getPhaseForTargetTime

public EVehiclePhase getPhaseForTargetTime(long targetTime)

getStatusForTargetTime

public String getStatusForTargetTime(long targetTime)

getLastUpdateTime

public long getLastUpdateTime(long targetTime)

addRecord

public BlockLocationRecordCollection addRecord(BlockInstance blockInstance,
                                               BlockLocationRecord record,
                                               long windowSize)


Copyright © 2012 OneBusAway. All Rights Reserved.