use of org.onebusaway.transit_data_federation.services.transit_graph.BlockEntry in project onebusaway-application-modules by camsys.
the class BlockIndexServiceImpl method loadBlockTripIndicesByBlockId.
/**
**
*
***
*/
private void loadBlockTripIndicesByBlockId() {
_log.info("calculating block trip indices by blockId...");
long t1 = SystemTime.currentTimeMillis();
_blockTripIndicesByBlockId = new HashMap<AgencyAndId, List<BlockTripIndex>>();
_blockLayoverIndicesByBlockId = new HashMap<AgencyAndId, List<BlockLayoverIndex>>();
_frequencyBlockTripIndicesByBlockId = new HashMap<AgencyAndId, List<FrequencyBlockTripIndex>>();
for (BlockEntry block : _graphDao.getAllBlocks()) {
List<BlockEntry> list = Arrays.asList(block);
List<BlockTripIndex> indices = _factory.createTripIndices(list);
List<BlockLayoverIndex> layoverIndices = _factory.createLayoverIndices(list);
List<FrequencyBlockTripIndex> frequencyIndices = _factory.createFrequencyTripIndices(list);
if (!indices.isEmpty())
_blockTripIndicesByBlockId.put(block.getId(), indices);
if (!layoverIndices.isEmpty())
_blockLayoverIndicesByBlockId.put(block.getId(), layoverIndices);
if (!frequencyIndices.isEmpty())
_frequencyBlockTripIndicesByBlockId.put(block.getId(), frequencyIndices);
}
long t2 = SystemTime.currentTimeMillis();
_log.info("completed calculating block trip indices by blockId: t=" + (t2 - t1));
}
Aggregations