org.onebusaway.transit_data_federation.impl.realtime
Class BlockLocationRecordCollection
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BlockLocationRecordCollection
public BlockLocationRecordCollection(long fromTime,
long toTime,
SortedMap<Long,BlockLocationRecord> records)
BlockLocationRecordCollection
public BlockLocationRecordCollection(long fromTime,
long toTime)
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.