org.onebusaway.transit_data_federation.services.blocks
Class BlockIndex

java.lang.Object
  extended by org.onebusaway.transit_data_federation.services.blocks.BlockIndex
All Implemented Interfaces:
HasBlocks

public class BlockIndex
extends Object
implements HasBlocks

A BlockIndex is a collection of BlockConfigurationEntry elements that have the following properties in common: 1) Each BlockConfigurationEntry refers to the same stop sequence pattern and underlying shape of travel. 2) Each BlockConfigurationEntry has the same set of service ids (see BlockConfigurationEntry.getServiceIds() 3) The list of BlockConfigurationEntry elements is sorted by arrival time and no block ever overtakes another block. 4) The ServiceIntervalBlock additionally captures the min and max arrival and departure times for each block 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

Constructor Summary
BlockIndex(List<BlockConfigurationEntry> blocks, ServiceIntervalBlock serviceIntervalBlock)
          See the requirements in the class documentation.
 
Method Summary
 List<BlockConfigurationEntry> getBlocks()
           
 ServiceIdActivation getServiceIds()
           
 ServiceIntervalBlock getServiceIntervalBlock()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlockIndex

public BlockIndex(List<BlockConfigurationEntry> blocks,
                  ServiceIntervalBlock serviceIntervalBlock)
See the requirements in the class documentation.

Parameters:
blocks -
serviceIdIntervals -
serviceIntervalBlock -
Method Detail

getBlocks

public List<BlockConfigurationEntry> getBlocks()
Specified by:
getBlocks in interface HasBlocks
Returns:
the list of BlockConfigurationEntry elements.

getServiceIds

public ServiceIdActivation getServiceIds()
Specified by:
getServiceIds in interface HasBlocks
Returns:
the service calendar activation for the list of BlockConfigurationEntry elements.

getServiceIntervalBlock

public ServiceIntervalBlock getServiceIntervalBlock()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 OneBusAway. All Rights Reserved.