org.onebusaway.transit_data_federation.services.blocks
Class FrequencyBlockTripIndex

java.lang.Object
  extended by org.onebusaway.transit_data_federation.services.blocks.AbstractBlockTripIndex
      extended by org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockTripIndex
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.

Author:
bdferris
See Also:
BlockCalendarService

Field Summary
 
Fields inherited from class org.onebusaway.transit_data_federation.services.blocks.AbstractBlockTripIndex
_trips
 
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)
          HasIndexedFrequencyBlockTrips
 String toString()
           
 
Methods inherited from class org.onebusaway.transit_data_federation.services.blocks.AbstractBlockTripIndex
getServiceIds, getTrips, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrequencyBlockTripIndex

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

Parameters:
trips -
serviceIdIntervals -
serviceIntervalBlock -
Method Detail

getFrequencies

public List<FrequencyEntry> getFrequencies()

getServiceIntervalBlock

public FrequencyServiceIntervalBlock getServiceIntervalBlock()

toString

public String toString()
Overrides:
toString in class Object

getStartTimeForIndex

public int getStartTimeForIndex(int index)
HasIndexedFrequencyBlockTrips

Specified by:
getStartTimeForIndex in interface HasIndexedFrequencyBlockTrips

getEndTimeForIndex

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


Copyright © 2011 OneBusAway. All Rights Reserved.