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;
}
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;
}
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;
}
Aggregations