Package org.onebusaway.transit_data.model.trips

Examples of org.onebusaway.transit_data.model.trips.TripBean


    List<ArrivalAndDepartureBeanV1> v1s = new ArrayList<ArrivalAndDepartureBeanV1>();

    for (ArrivalAndDepartureBean bean : result.getArrivalsAndDepartures()) {

      TripBean trip = bean.getTrip();
      RouteBean route = trip.getRoute();
      StopBean stop = bean.getStop();
     
      ArrivalAndDepartureBeanV1 v1 = new ArrivalAndDepartureBeanV1();
      v1.setPredictedArrivalTime(bean.getPredictedArrivalTime());
      v1.setPredictedDepartureTime(bean.getPredictedDepartureTime());
      v1.setRouteId(route.getId());
      if (trip.getRouteShortName() != null)
        v1.setRouteShortName(trip.getRouteShortName());
      else
        v1.setRouteShortName(route.getShortName());
      v1.setScheduledArrivalTime(bean.getScheduledArrivalTime());
      v1.setScheduledDepartureTime(bean.getScheduledDepartureTime());
      v1.setStatus(bean.getStatus());     
      v1.setStopId(stop.getId());
      v1.setTripHeadsign(trip.getTripHeadsign());
      v1.setTripId(trip.getId());

      v1s.add(v1);
    }

    return v1s;
View Full Code Here


      vehicle.setVehicleId("1_v1");

      TripStatusBean tripStatus = new TripStatusBean();
      vehicle.setTripStatus(tripStatus);

      TripBean trip = new TripBean();
      trip.setId("1_t0");
      trip.setRoute(route);
      tripStatus.setActiveTrip(trip);

      vehicle.setLocation(new CoordinatePoint(47.0, -122.0));
    }
    {
      VehicleStatusBean vehicle = new VehicleStatusBean();
      vehicles.add(vehicle);
      vehicle.setLastUpdateTime(5678 * 1000);
      vehicle.setVehicleId("1_v2");

      TripStatusBean tripStatus = new TripStatusBean();
      vehicle.setTripStatus(tripStatus);

      TripBean trip = new TripBean();
      trip.setId("1_t1");
      trip.setRoute(route);
      tripStatus.setActiveTrip(trip);

      vehicle.setLocation(new CoordinatePoint(47.1, -122.1));
    }

View Full Code Here

      vehicle.setVehicleId("1_v1");

      TripStatusBean tripStatus = new TripStatusBean();
      vehicle.setTripStatus(tripStatus);

      TripBean trip = new TripBean();
      trip.setId("1_t0");
      trip.setRoute(route);
      tripStatus.setActiveTrip(trip);

      StopBean stop = new StopBean();
      stop.setId("1_s2");
      tripStatus.setNextStop(stop);
      tripStatus.setNextStopTimeOffset(5 * 60);
    }
    {
      VehicleStatusBean vehicle = new VehicleStatusBean();
      vehicles.add(vehicle);
      vehicle.setLastUpdateTime(5678 * 1000);
      vehicle.setVehicleId("1_v2");

      TripStatusBean tripStatus = new TripStatusBean();
      vehicle.setTripStatus(tripStatus);

      TripBean trip = new TripBean();
      trip.setId("1_t1");
      trip.setRoute(route);
      tripStatus.setActiveTrip(trip);

      StopBean stop = new StopBean();
      stop.setId("1_s3");
      tripStatus.setNextStop(stop);
View Full Code Here

    StopsWithArrivalsAndDeparturesBean result = _model.getResult();
    Iterator<ArrivalAndDepartureBean> it = result.getArrivalsAndDepartures().iterator();

    while (it.hasNext()) {
      ArrivalAndDepartureBean bean = it.next();
      TripBean trip = bean.getTrip();
      RouteBean route = trip.getRoute();
      String routeName = RoutePresenter.getNameForRoute(route);
      if (!routes.contains(routeName))
        it.remove();
    }
  }
View Full Code Here

      double distanceFromStop = adbean.getDistanceFromStop();
      if (distanceFromStop < 0) {
        /* passed this stop */
        continue;
      }
      TripBean trip = adbean.getTrip();
      RouteBean route = trip.getRoute();
      if (routeId != null && !route.getId().equals(routeId)) {
        // filtered out
        continue;
      }
      if (directionId != null && !trip.getDirectionId().equals(directionId)) {
        // filtered out
        continue;
      }

      /*
       * gather data about trip, route, and stops
       */
      TripDetailsQueryBean query = new TripDetailsQueryBean();
      query.setTripId(trip.getId());
      query.setServiceDate(adbean.getServiceDate());
      query.setTime(now.getTime().getTime());
      query.setVehicleId(adbean.getVehicleId());

      ListBean<TripDetailsBean> trips = _transitDataService.getTripDetails(query);
View Full Code Here

  public TransitLegV2Bean getTransitLeg(TransitLegBean leg) {

    TransitLegV2Bean bean = new TransitLegV2Bean();

    TripBean trip = leg.getTrip();
    if (trip != null) {
      bean.setTripId(trip.getId());
      _factory.addToReferences(trip);
    }

    bean.setServiceDate(leg.getServiceDate());
    bean.setVehicleId(leg.getVehicleId());
View Full Code Here

    TransitLegBean bean = new TransitLegBean();

    String tripId = leg.getTripId();
    if (tripId != null && !tripId.isEmpty()) {
      TripBean trip = new TripBean();
      trip.setId(tripId);
      bean.setTrip(trip);
    }

    bean.setServiceDate(leg.getServiceDate());
    if (_factory.isStringSet(leg.getVehicleId()))
View Full Code Here

  public TripStatusV2Bean getTripStatus(TripStatusBean tripStatus) {

    TripStatusV2Bean bean = new TripStatusV2Bean();

    TripBean activeTrip = tripStatus.getActiveTrip();
    if (activeTrip != null) {
      bean.setActiveTripId(activeTrip.getId());
      bean.setBlockTripSequence(tripStatus.getBlockTripSequence());
      addToReferences(activeTrip);
    }

    bean.setServiceDate(tripStatus.getServiceDate());
View Full Code Here

      instances.add(stiBean);
    }

    bean.setStopTimes(instances);

    TripBean nextTrip = tripStopTimes.getNextTrip();
    if (nextTrip != null) {
      bean.setNextTripId(nextTrip.getId());
      addToReferences(nextTrip);
    }

    TripBean prevTrip = tripStopTimes.getPreviousTrip();
    if (prevTrip != null) {
      bean.setPreviousTripId(prevTrip.getId());
      addToReferences(prevTrip);
    }

    FrequencyBean freq = tripStopTimes.getFrequency();
    if (freq != null)
View Full Code Here

    bean.setServiceDate(tripDetails.getServiceDate());

    if (tripDetails.getFrequency() != null)
      bean.setFrequency(getFrequency(tripDetails.getFrequency()));

    TripBean trip = tripDetails.getTrip();
    if (trip != null)
      addToReferences(trip);

    TripStopTimesBean stopTimes = tripDetails.getSchedule();
    if (stopTimes != null)
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.trips.TripBean

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.