Package org.onebusaway.transit_data_federation.services.transit_graph

Examples of org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry


    @Override
    public BlockStopTimeEntry get(int index) {

      int tripIndex = tripIndices[index];

      BlockTripEntry blockTrip = trips.get(tripIndex);
      TripEntry trip = blockTrip.getTrip();

      List<StopTimeEntry> stopTimes = trip.getStopTimes();
      int stopTimeIndex = index - accumulatedStopTimeIndices[tripIndex];
      StopTimeEntry stopTime = stopTimes.get(stopTimeIndex);
View Full Code Here


    }

    @Override
    public FrequencyBlockStopTimeEntry get(int index) {
      List<BlockTripEntry> trips = _index.getTrips();
      BlockTripEntry trip = trips.get(index);
      BlockStopTimeEntry blockStopTime = trip.getStopTimes().get(_offset);
      List<FrequencyEntry> frequencies = _index.getFrequencies();
      FrequencyEntry frequency = frequencies.get(index);
      return new FrequencyBlockStopTimeEntryImpl(blockStopTime, frequency);
    }
View Full Code Here

     ****/

    List<BlockTripEntry> blockTrips = entry.getTrips();
    assertEquals(3, blockTrips.size());

    BlockTripEntry blockTrip = blockTrips.get(0);
    assertEquals(0, blockTrip.getSequence());
    assertEquals(0, blockTrip.getAccumulatedStopTimeIndex());
    assertEquals(0, blockTrip.getAccumulatedSlackTime());
    assertEquals(0.0, blockTrip.getDistanceAlongBlock(), 0.0);
    assertSame(blockTrips.get(1), blockTrip.getNextTrip());
    assertNull(blockTrip.getPreviousTrip());

    blockTrip = blockTrips.get(1);
    assertEquals(1, blockTrip.getSequence());
    assertEquals(2, blockTrip.getAccumulatedStopTimeIndex());
    assertEquals(15 * 60, blockTrip.getAccumulatedSlackTime());
    assertEquals(1010.0, blockTrip.getDistanceAlongBlock(), 0.0);
    assertSame(blockTrips.get(2), blockTrip.getNextTrip());
    assertSame(blockTrips.get(0), blockTrip.getPreviousTrip());

    blockTrip = blockTrips.get(2);
    assertEquals(2, blockTrip.getSequence());
    assertEquals(4, blockTrip.getAccumulatedStopTimeIndex());
    assertEquals(35 * 60, blockTrip.getAccumulatedSlackTime());
    assertEquals(3030.0, blockTrip.getDistanceAlongBlock(), 0.0);
    assertNull(blockTrip.getNextTrip());
    assertSame(blockTrips.get(1), blockTrip.getPreviousTrip());

    /****
     * Stop Times
     ****/

 
View Full Code Here

      Set<StopSequenceKey> outboundSequences = new HashSet<StopSequenceKey>();

      List<BlockStopTimeIndex> blockStopTimeIndices = _blockIndexService.getStopTimeIndicesForStop(stopEntry);
      for (BlockStopTimeIndex index : blockStopTimeIndices) {
        for (BlockStopTimeEntry blockStopTime : index.getStopTimes()) {
          BlockTripEntry blockTrip = blockStopTime.getTrip();
          StopSequenceKey outboundSequence = data.getSequenceForTrip(blockTrip.getTrip());
          outboundSequences.add(outboundSequence);
        }
      }

      for (StopSequenceKey outboundSequence : outboundSequences) {
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.services.transit_graph.BlockTripEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.