Search in sources :

Example 71 with BlockTripEntry

use of org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry in project onebusaway-application-modules by camsys.

the class BlockStopTimeIndicesFactory method getStopTimesAsFrequencyStopTimes.

private List<FrequencyBlockStopTimeEntry> getStopTimesAsFrequencyStopTimes(List<BlockStopTimeEntry> stopTimes) {
    List<FrequencyBlockStopTimeEntry> frequencyStopTimes = new ArrayList<FrequencyBlockStopTimeEntry>();
    for (BlockStopTimeEntry blockStopTime : stopTimes) {
        BlockTripEntry trip = blockStopTime.getTrip();
        BlockConfigurationEntry blockConfig = trip.getBlockConfiguration();
        for (FrequencyEntry frequency : blockConfig.getFrequencies()) {
            FrequencyBlockStopTimeEntry frequencyStopTime = new FrequencyBlockStopTimeEntryImpl(blockStopTime, frequency);
            frequencyStopTimes.add(frequencyStopTime);
        }
    }
    return frequencyStopTimes;
}
Also used : BlockTripEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry) ArrayList(java.util.ArrayList) FrequencyEntry(org.onebusaway.transit_data_federation.services.transit_graph.FrequencyEntry) BlockConfigurationEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockConfigurationEntry) BlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockStopTimeEntry) FrequencyBlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.FrequencyBlockStopTimeEntry) FrequencyBlockStopTimeEntryImpl(org.onebusaway.transit_data_federation.impl.transit_graph.FrequencyBlockStopTimeEntryImpl) FrequencyBlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.FrequencyBlockStopTimeEntry)

Example 72 with BlockTripEntry

use of org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry in project onebusaway-application-modules by camsys.

the class BlockStopTimeIndicesFactory method getBlockStopTimeAsKey.

private BlockStopTimeKey getBlockStopTimeAsKey(BlockStopTimeEntry blockStopTime) {
    BlockTripEntry blockTrip = blockStopTime.getTrip();
    BlockConfigurationEntry blockConfig = blockTrip.getBlockConfiguration();
    StopTimeEntry stopTime = blockStopTime.getStopTime();
    StopEntry stop = stopTime.getStop();
    return new BlockStopTimeKey(blockConfig.getServiceIds(), stop.getId());
}
Also used : BlockTripEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry) BlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockStopTimeEntry) StopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.StopTimeEntry) FrequencyBlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.FrequencyBlockStopTimeEntry) StopEntry(org.onebusaway.transit_data_federation.services.transit_graph.StopEntry) BlockConfigurationEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockConfigurationEntry)

Aggregations

BlockTripEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry)72 BlockStopTimeEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockStopTimeEntry)30 TripEntry (org.onebusaway.transit_data_federation.services.transit_graph.TripEntry)27 ArrayList (java.util.ArrayList)26 BlockConfigurationEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockConfigurationEntry)25 AgencyAndId (org.onebusaway.gtfs.model.AgencyAndId)23 StopTimeEntry (org.onebusaway.transit_data_federation.services.transit_graph.StopTimeEntry)15 List (java.util.List)11 FrequencyEntry (org.onebusaway.transit_data_federation.services.transit_graph.FrequencyEntry)10 StopEntry (org.onebusaway.transit_data_federation.services.transit_graph.StopEntry)10 FactoryMap (org.onebusaway.collections.FactoryMap)9 BlockInstance (org.onebusaway.transit_data_federation.services.blocks.BlockInstance)8 HashSet (java.util.HashSet)7 CoordinatePoint (org.onebusaway.geospatial.model.CoordinatePoint)7 StopTimeInstance (org.onebusaway.transit_data_federation.model.StopTimeInstance)7 InstanceState (org.onebusaway.transit_data_federation.services.blocks.InstanceState)7 Date (java.util.Date)6 FrequencyBlockTripIndex (org.onebusaway.transit_data_federation.services.blocks.FrequencyBlockTripIndex)6 ServiceInterval (org.onebusaway.gtfs.model.calendar.ServiceInterval)5 StopSequence (org.onebusaway.transit_data_federation.model.StopSequence)5