Package com.google.transit.realtime.GtfsRealtime

Examples of com.google.transit.realtime.GtfsRealtime.TripUpdate


    int totalTrips = 0;
    int unknownTrips = 0;

    for (FeedEntity entity : tripUpdates.getEntityList()) {
      TripUpdate tripUpdate = entity.getTripUpdate();
      if (tripUpdate == null) {
        _log.warn("expected a FeedEntity with a TripUpdate");
        continue;
      }
      TripDescriptor trip = tripUpdate.getTrip();
      BlockDescriptor blockDescriptor = getTripDescriptorAsBlockDescriptor(result,
          trip, true);
      totalTrips++;
      if (blockDescriptor == null) {
        unknownTrips++;
View Full Code Here


    Collections.sort(groups);

    CombinedTripUpdatesAndVehiclePosition group = groups.get(0);
    assertSame(blockA, group.block.getBlockEntry());
    assertEquals(2, group.tripUpdates.size());
    TripUpdate tripUpdate = group.tripUpdates.get(0);
    assertEquals("tripA", tripUpdate.getTrip().getTripId());
    tripUpdate = group.tripUpdates.get(1);
    assertEquals("tripB", tripUpdate.getTrip().getTripId());

    group = groups.get(1);
    assertSame(blockB, group.block.getBlockEntry());
    assertEquals(2, group.tripUpdates.size());
    tripUpdate = group.tripUpdates.get(0);
    assertEquals("tripC", tripUpdate.getTrip().getTripId());
    tripUpdate = group.tripUpdates.get(1);
    assertEquals("tripD", tripUpdate.getTrip().getTripId());

    VehicleLocationRecord record = _library.createVehicleLocationRecordForUpdate(groups.get(0));
    assertEquals(blockA.getId(), record.getBlockId());
    assertEquals(120, record.getScheduleDeviation(), 0.0);
    assertEquals(0L, record.getServiceDate());
View Full Code Here

    assertEquals(2, feed.getEntityCount());

    {
      FeedEntity entity = feed.getEntity(0);
      assertEquals("1", entity.getId());
      TripUpdate tripUpdate = entity.getTripUpdate();
      assertEquals("t0", tripUpdate.getTrip().getTripId());
      assertEquals("r1", tripUpdate.getTrip().getRouteId());
      assertEquals("v1", tripUpdate.getVehicle().getId());
      assertEquals(1234, tripUpdate.getTimestamp());
      assertEquals(1, tripUpdate.getStopTimeUpdateCount());
      StopTimeUpdate stopTimeUpdate = tripUpdate.getStopTimeUpdate(0);
      assertEquals("s2", stopTimeUpdate.getStopId());
      assertEquals(now / 1000 + 5 * 60, stopTimeUpdate.getDeparture().getTime());
    }
    {
      FeedEntity entity = feed.getEntity(1);
      assertEquals("2", entity.getId());
      TripUpdate tripUpdate = entity.getTripUpdate();
      assertEquals("t1", tripUpdate.getTrip().getTripId());
      assertEquals("r1", tripUpdate.getTrip().getRouteId());
      assertEquals("v2", tripUpdate.getVehicle().getId());
      assertEquals(5678, tripUpdate.getTimestamp());
      assertEquals(1, tripUpdate.getStopTimeUpdateCount());
      StopTimeUpdate stopTimeUpdate = tripUpdate.getStopTimeUpdate(0);
      assertEquals("s3", stopTimeUpdate.getStopId());
      assertEquals(now / 1000 + 10 * 60,
          stopTimeUpdate.getDeparture().getTime());
    }
  }
View Full Code Here

TOP

Related Classes of com.google.transit.realtime.GtfsRealtime.TripUpdate

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.