Package org.onebusaway.transit_data.model

Examples of org.onebusaway.transit_data.model.RouteBean$Builder


    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());
View Full Code Here


    long now = System.currentTimeMillis();

    List<VehicleStatusBean> vehicles = new ArrayList<VehicleStatusBean>();
    RouteBean.Builder routeBuilder = RouteBean.builder();
    routeBuilder.setId("1_r1");
    RouteBean route = routeBuilder.create();

    {
      VehicleStatusBean vehicle = new VehicleStatusBean();
      vehicles.add(vehicle);
      vehicle.setLastUpdateTime(1234 * 1000);
 
View Full Code Here

      _value = "top";

    Object obj = findValue(_value);

    if (obj instanceof RouteBean) {
      RouteBean route = (RouteBean) obj;
      String value = RoutePresenter.getDescriptionForRoute(route);
      try {
        if( value != null)
          writer.write(value);
      } catch (IOException e) {
View Full Code Here

    long now = System.currentTimeMillis();

    List<VehicleStatusBean> vehicles = new ArrayList<VehicleStatusBean>();
    RouteBean.Builder routeBuilder = RouteBean.builder();
    routeBuilder.setId("1_r1");
    RouteBean route = routeBuilder.create();

    {
      VehicleStatusBean vehicle = new VehicleStatusBean();
      vehicles.add(vehicle);
      vehicle.setLastUpdateTime(1234 * 1000);
 
View Full Code Here

    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

      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
View Full Code Here

  public StopsForRouteV2Bean getStopsForRoute(StopsForRouteBean stopsForRoute,
      boolean includePolylines) {
    StopsForRouteV2Bean bean = new StopsForRouteV2Bean();

    RouteBean route = stopsForRoute.getRoute();
    if (route != null) {
      addToReferences(route);
      bean.setRouteId(route.getId());
    }

    List<String> stopIds = new ArrayList<String>();
    for (StopBean stop : stopsForRoute.getStops()) {
      stopIds.add(stop.getId());
View Full Code Here

  public ArrivalAndDepartureV2Bean getArrivalAndDeparture(
      ArrivalAndDepartureBean ad) {

    TripBean trip = ad.getTrip();
    RouteBean route = trip.getRoute();
    StopBean stop = ad.getStop();

    ArrivalAndDepartureV2Bean bean = new ArrivalAndDepartureV2Bean();

    bean.setTripId(trip.getId());
    addToReferences(trip);

    bean.setServiceDate(ad.getServiceDate());
    bean.setVehicleId(ad.getVehicleId());
    bean.setStopId(stop.getId());
    addToReferences(stop);
    bean.setStopSequence(ad.getStopSequence());
    bean.setBlockTripSequence(ad.getBlockTripSequence());

    bean.setRouteId(route.getId());
    addToReferences(route);

    String routeShortName = ad.getRouteShortName();
    if (routeShortName == null || routeShortName.isEmpty())
      routeShortName = trip.getRouteShortName();
    if (routeShortName == null || routeShortName.isEmpty())
      routeShortName = route.getShortName();
    bean.setRouteShortName(routeShortName);

    bean.setRouteLongName(route.getLongName());

    String tripHeadsign = ad.getTripHeadsign();
    if (tripHeadsign == null || tripHeadsign.isEmpty())
      tripHeadsign = trip.getTripHeadsign();
    bean.setTripHeadsign(tripHeadsign);
View Full Code Here

    TripBean tripBean = trip.getTrip();

    MonitoredVehicleJourney monitoredVehicleJourney = new MonitoredVehicleJourney();

    monitoredVehicleJourney.CourseOfJourneyRef = getIdWithoutAgency(trip.getTripId());
    RouteBean route = tripBean.getRoute();
    monitoredVehicleJourney.LineRef = getIdWithoutAgency(route.getId());
    monitoredVehicleJourney.DirectionRef = tripBean.getDirectionId();
    monitoredVehicleJourney.PublishedLineName = tripBean.getTripHeadsign();

    monitoredVehicleJourney.FramedVehicleJourneyRef = new FramedVehicleJourneyRef();
    monitoredVehicleJourney.VehicleRef = vehicleId;
View Full Code Here

      VehiclePosition.Builder vehiclePosition = entity.getVehicleBuilder();

      TripStatusBean tripStatus = vehicle.getTripStatus();
      if (tripStatus != null) {
        TripBean activeTrip = tripStatus.getActiveTrip();
        RouteBean route = activeTrip.getRoute();

        TripDescriptor.Builder tripDesc = vehiclePosition.getTripBuilder();
        tripDesc.setTripId(normalizeId(activeTrip.getId()));
        tripDesc.setRouteId(normalizeId(route.getId()));
      }

      VehicleDescriptor.Builder vehicleDesc = vehiclePosition.getVehicleBuilder();
      vehicleDesc.setId(normalizeId(vehicle.getVehicleId()));
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.RouteBean$Builder

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.