Search in sources :

Example 1 with BlockTripReference

use of org.onebusaway.transit_data_federation.services.blocks.BlockTripReference in project onebusaway-application-modules by camsys.

the class BlockIndexFactoryServiceImpl method createTripData.

/**
 **
 *
 ***
 */
public List<BlockTripIndexData> createTripData(Iterable<BlockEntry> blocks) {
    List<BlockTripIndex> indices = createTripIndices(blocks);
    List<BlockTripIndexData> allData = new ArrayList<BlockTripIndexData>();
    for (BlockTripIndex index : indices) {
        List<BlockTripReference> references = new ArrayList<BlockTripReference>();
        for (BlockTripEntry trip : index.getTrips()) {
            BlockTripReference ref = ReferencesLibrary.getTripAsReference(trip);
            references.add(ref);
        }
        ServiceIntervalBlock serviceIntervalBlock = index.getServiceIntervalBlock();
        BlockTripIndexData data = new BlockTripIndexData(references, serviceIntervalBlock);
        allData.add(data);
    }
    return allData;
}
Also used : BlockTripReference(org.onebusaway.transit_data_federation.services.blocks.BlockTripReference) ServiceIntervalBlock(org.onebusaway.transit_data_federation.services.blocks.ServiceIntervalBlock) FrequencyServiceIntervalBlock(org.onebusaway.transit_data_federation.services.blocks.FrequencyServiceIntervalBlock) BlockTripEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry) ArrayList(java.util.ArrayList) BlockTripIndex(org.onebusaway.transit_data_federation.services.blocks.BlockTripIndex) FrequencyBlockTripIndex(org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockTripIndex) FrequencyBlockTripIndexData(org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockTripIndexData) BlockTripIndexData(org.onebusaway.transit_data_federation.services.blocks.BlockTripIndexData)

Example 2 with BlockTripReference

use of org.onebusaway.transit_data_federation.services.blocks.BlockTripReference in project onebusaway-application-modules by camsys.

the class BlockIndexFactoryServiceImpl method createLayoverData.

public List<BlockLayoverIndexData> createLayoverData(Iterable<BlockEntry> blocks) {
    List<BlockLayoverIndex> indices = createLayoverIndices(blocks);
    List<BlockLayoverIndexData> allData = new ArrayList<BlockLayoverIndexData>();
    for (BlockLayoverIndex index : indices) {
        List<BlockTripReference> references = new ArrayList<BlockTripReference>();
        for (BlockTripEntry trip : index.getTrips()) {
            BlockTripReference ref = ReferencesLibrary.getTripAsReference(trip);
            references.add(ref);
        }
        LayoverIntervalBlock layoverIntervalBlock = index.getLayoverIntervalBlock();
        BlockLayoverIndexData data = new BlockLayoverIndexData(references, layoverIntervalBlock);
        allData.add(data);
    }
    return allData;
}
Also used : BlockTripReference(org.onebusaway.transit_data_federation.services.blocks.BlockTripReference) LayoverIntervalBlock(org.onebusaway.transit_data_federation.services.blocks.LayoverIntervalBlock) BlockTripEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry) ArrayList(java.util.ArrayList) BlockLayoverIndexData(org.onebusaway.transit_data_federation.services.blocks.BlockLayoverIndexData) BlockLayoverIndex(org.onebusaway.transit_data_federation.services.blocks.BlockLayoverIndex)

Example 3 with BlockTripReference

use of org.onebusaway.transit_data_federation.services.blocks.BlockTripReference in project onebusaway-application-modules by camsys.

the class BlockIndexFactoryServiceImpl method createFrequencyTripData.

public List<FrequencyBlockTripIndexData> createFrequencyTripData(Iterable<BlockEntry> blocks) {
    List<FrequencyBlockTripIndex> indices = createFrequencyTripIndices(blocks);
    List<FrequencyBlockTripIndexData> allData = new ArrayList<FrequencyBlockTripIndexData>();
    for (FrequencyBlockTripIndex index : indices) {
        List<BlockTripReference> tripReferences = new ArrayList<BlockTripReference>();
        for (BlockTripEntry entry : index.getTrips()) {
            BlockTripReference reference = ReferencesLibrary.getTripAsReference(entry);
            tripReferences.add(reference);
        }
        FrequencyServiceIntervalBlock serviceIntervalBlock = index.getServiceIntervalBlock();
        FrequencyBlockTripIndexData data = new FrequencyBlockTripIndexData(tripReferences, index.getFrequencies(), serviceIntervalBlock);
        allData.add(data);
    }
    return allData;
}
Also used : FrequencyBlockTripIndex(org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockTripIndex) BlockTripReference(org.onebusaway.transit_data_federation.services.blocks.BlockTripReference) FrequencyServiceIntervalBlock(org.onebusaway.transit_data_federation.services.blocks.FrequencyServiceIntervalBlock) BlockTripEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry) ArrayList(java.util.ArrayList) FrequencyBlockTripIndexData(org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockTripIndexData)

Aggregations

ArrayList (java.util.ArrayList)3 BlockTripReference (org.onebusaway.transit_data_federation.services.blocks.BlockTripReference)3 BlockTripEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry)3 FrequencyBlockTripIndex (org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockTripIndex)2 FrequencyBlockTripIndexData (org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockTripIndexData)2 FrequencyServiceIntervalBlock (org.onebusaway.transit_data_federation.services.blocks.FrequencyServiceIntervalBlock)2 BlockLayoverIndex (org.onebusaway.transit_data_federation.services.blocks.BlockLayoverIndex)1 BlockLayoverIndexData (org.onebusaway.transit_data_federation.services.blocks.BlockLayoverIndexData)1 BlockTripIndex (org.onebusaway.transit_data_federation.services.blocks.BlockTripIndex)1 BlockTripIndexData (org.onebusaway.transit_data_federation.services.blocks.BlockTripIndexData)1 LayoverIntervalBlock (org.onebusaway.transit_data_federation.services.blocks.LayoverIntervalBlock)1 ServiceIntervalBlock (org.onebusaway.transit_data_federation.services.blocks.ServiceIntervalBlock)1