use of org.onebusaway.transit_data_federation.services.blocks.BlockSequenceIndex in project onebusaway-application-modules by camsys.
the class BlockIndexFactoryServiceImpl method createSequenceIndexForGroupOfBlockSequences.
public BlockSequenceIndex createSequenceIndexForGroupOfBlockSequences(List<BlockSequence> sequences) {
ServiceIntervalBlock serviceIntervalBlock = getBlockStopTimesAsBlockInterval(sequences);
String agencyId = sequences.get(0).getBlockConfig().getBlock().getId().getAgencyId();
boolean privateService = _privateAgencyIds.contains(agencyId);
return new BlockSequenceIndex(sequences, serviceIntervalBlock, privateService);
}
use of org.onebusaway.transit_data_federation.services.blocks.BlockSequenceIndex in project onebusaway-application-modules by camsys.
the class BlockIndexServiceImpl method loadStopTripIndices.
private void loadStopTripIndices() {
// Clear any existing indices
for (StopEntry stop : _graphDao.getAllStops()) {
StopEntryImpl stopImpl = (StopEntryImpl) stop;
stopImpl.getStopTripIndices().clear();
stopImpl.getFrequencyStopTripIndices().clear();
}
for (BlockSequenceIndex index : _blockSequenceIndices) {
BlockSequence sequence = index.getSequences().get(0);
int offset = 0;
for (BlockStopTimeEntry bst : sequence.getStopTimes()) {
StopTimeEntry stopTime = bst.getStopTime();
StopEntryImpl stop = (StopEntryImpl) stopTime.getStop();
BlockStopSequenceIndex blockStopTripIndex = new BlockStopSequenceIndex(index, offset);
stop.addBlockStopTripIndex(blockStopTripIndex);
offset++;
}
}
for (FrequencyBlockTripIndex index : _frequencyBlockTripIndices) {
BlockTripEntry trip = index.getTrips().get(0);
int offset = 0;
for (BlockStopTimeEntry bst : trip.getStopTimes()) {
StopTimeEntry stopTime = bst.getStopTime();
StopEntryImpl stop = (StopEntryImpl) stopTime.getStop();
FrequencyStopTripIndex stopTripIndex = new FrequencyStopTripIndex(index, offset);
stop.addFrequencyStopTripIndex(stopTripIndex);
offset++;
}
}
}
Aggregations