Class FrequencyBlockTripIndex

  extended by
      extended by
All Implemented Interfaces:
HasBlockTrips, HasIndexedFrequencyBlockTrips

public class FrequencyBlockTripIndex
extends AbstractBlockTripIndex
implements HasIndexedFrequencyBlockTrips

A FrequencyBlockTripIndex is a collection of BlockTripEntry elements that have the following properties in common: 1) Each BlockTripEntry refers to the same stop sequence pattern and underlying shape of travel. 2) Each BlockTripEntry has the same set of service ids (see BlockConfigurationEntry.getServiceIds() 3) Each BlockTripEntry refers to a frequency-based trip with a FrequencyEntry. Since the same BlockTripEntry can have multiple FrequencyEntry, a trip may appear more than once in the index. 4) The list of FrequencyEntry elements is sorted by start time and no frequency block ever overtakes another block. 4) The ServiceIntervalBlock additionally captures the min and max arrival and departure times for each trip in the list, in the same sorted order as the block list. These assumptions allow us to do efficient searches for blocks that are active at a particular time.

See Also:

Field Summary
Fields inherited from class
Constructor Summary
FrequencyBlockTripIndex(List<BlockTripEntry> trips, List<FrequencyEntry> frequencies, FrequencyServiceIntervalBlock serviceIntervalBlock)
          See the requirements in the class documentation.
Method Summary
 int getEndTimeForIndex(int index)
 List<FrequencyEntry> getFrequencies()
 FrequencyServiceIntervalBlock getServiceIntervalBlock()
 int getStartTimeForIndex(int index)
 String toString()
Methods inherited from class
getServiceIds, getTrips, size
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public FrequencyBlockTripIndex(List<BlockTripEntry> trips,
                               List<FrequencyEntry> frequencies,
                               FrequencyServiceIntervalBlock serviceIntervalBlock)
See the requirements in the class documentation.

trips -
serviceIdIntervals -
serviceIntervalBlock -
Method Detail


public List<FrequencyEntry> getFrequencies()


public FrequencyServiceIntervalBlock getServiceIntervalBlock()


public String toString()
toString in class Object


public int getStartTimeForIndex(int index)

Specified by:
getStartTimeForIndex in interface HasIndexedFrequencyBlockTrips


public int getEndTimeForIndex(int index)
Specified by:
getEndTimeForIndex in interface HasIndexedFrequencyBlockTrips

Copyright © 2012 OneBusAway. All Rights Reserved.