Search in sources :

Example 1 with BlockSequence

use of org.onebusaway.transit_data_federation.impl.blocks.BlockSequence in project onebusaway-application-modules by camsys.

the class BlockSequenceIndex method toString.

@Override
public String toString() {
    BlockSequence first = _sequences.get(0);
    BlockConfigurationEntry blockConfig = first.getBlockConfig();
    BlockEntry block = blockConfig.getBlock();
    List<BlockStopTimeEntry> bsts = first.getStopTimes();
    BlockStopTimeEntry firstBst = bsts.get(0);
    BlockStopTimeEntry lastBst = bsts.get(bsts.size() - 1);
    StopEntry fromStop = firstBst.getStopTime().getStop();
    StopEntry toStop = lastBst.getStopTime().getStop();
    return "BlockSequenceIndex [ex: block=" + block.getId() + " fromStop=" + fromStop.getId() + " toStop=" + toStop.getId() + " serviceIds=" + getServiceIds() + "]";
}
Also used : BlockSequence(org.onebusaway.transit_data_federation.impl.blocks.BlockSequence) BlockEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockEntry) StopEntry(org.onebusaway.transit_data_federation.services.transit_graph.StopEntry) BlockConfigurationEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockConfigurationEntry) BlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockStopTimeEntry)

Example 2 with BlockSequence

use of org.onebusaway.transit_data_federation.impl.blocks.BlockSequence in project onebusaway-application-modules by camsys.

the class BlockStopSequenceIndex method getArrivalTimeForIndex.

@Override
public int getArrivalTimeForIndex(int index) {
    List<BlockSequence> sequences = _index.getSequences();
    BlockSequence sequence = sequences.get(index);
    return sequence.getArrivalTimeForIndex(_offset);
}
Also used : BlockSequence(org.onebusaway.transit_data_federation.impl.blocks.BlockSequence)

Example 3 with BlockSequence

use of org.onebusaway.transit_data_federation.impl.blocks.BlockSequence in project onebusaway-application-modules by camsys.

the class BlockStopSequenceIndex method getDepartureTimeForIndex.

@Override
public int getDepartureTimeForIndex(int index) {
    List<BlockSequence> sequences = _index.getSequences();
    BlockSequence sequence = sequences.get(index);
    return sequence.getDepartureTimeForIndex(_offset);
}
Also used : BlockSequence(org.onebusaway.transit_data_federation.impl.blocks.BlockSequence)

Example 4 with BlockSequence

use of org.onebusaway.transit_data_federation.impl.blocks.BlockSequence in project onebusaway-application-modules by camsys.

the class BlockStopSequenceIndex method computeServiceInterval.

/**
 **
 * Private Methods
 ***
 */
private ServiceInterval computeServiceInterval(BlockSequenceIndex index, int stopIndex) {
    List<BlockSequence> sequences = _index.getSequences();
    BlockStopTimeEntry fromBst = sequences.get(0).getStopTimes().get(stopIndex);
    BlockStopTimeEntry toBst = sequences.get(sequences.size() - 1).getStopTimes().get(stopIndex);
    StopTimeEntry fromSt = fromBst.getStopTime();
    StopTimeEntry toSt = toBst.getStopTime();
    return new ServiceInterval(fromSt.getArrivalTime(), fromSt.getDepartureTime(), toSt.getArrivalTime(), toSt.getDepartureTime());
}
Also used : BlockSequence(org.onebusaway.transit_data_federation.impl.blocks.BlockSequence) StopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.StopTimeEntry) BlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockStopTimeEntry) ServiceInterval(org.onebusaway.gtfs.model.calendar.ServiceInterval) BlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockStopTimeEntry)

Example 5 with BlockSequence

use of org.onebusaway.transit_data_federation.impl.blocks.BlockSequence in project onebusaway-application-modules by camsys.

the class BlockStopSequenceIndex method toString.

@Override
public String toString() {
    List<BlockSequence> sequences = _index.getSequences();
    BlockSequence sequence = sequences.get(0);
    List<BlockStopTimeEntry> stopTimes = sequence.getStopTimes();
    BlockStopTimeEntry bst = stopTimes.get(_offset);
    return bst.toString();
}
Also used : BlockSequence(org.onebusaway.transit_data_federation.impl.blocks.BlockSequence) BlockStopTimeEntry(org.onebusaway.transit_data_federation.services.transit_graph.BlockStopTimeEntry)

Aggregations

BlockSequence (org.onebusaway.transit_data_federation.impl.blocks.BlockSequence)5 BlockStopTimeEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockStopTimeEntry)3 ServiceInterval (org.onebusaway.gtfs.model.calendar.ServiceInterval)1 BlockConfigurationEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockConfigurationEntry)1 BlockEntry (org.onebusaway.transit_data_federation.services.transit_graph.BlockEntry)1 StopEntry (org.onebusaway.transit_data_federation.services.transit_graph.StopEntry)1 StopTimeEntry (org.onebusaway.transit_data_federation.services.transit_graph.StopTimeEntry)1