Examples of ItineraryBean


Examples of org.onebusaway.transit_data.model.tripplanning.ItineraryBean

    boolean computationTimeLimitReached = false;

    if (!CollectionsLibrary.isEmpty(paths)) {
      for (GraphPath path : paths) {

        ItineraryBean itinerary = getPathAsItinerary(path, options);
        beans.add(itinerary);
      }
    }

    bean.setComputationTimeLimitReached(computationTimeLimitReached);
View Full Code Here

Examples of org.onebusaway.transit_data.model.tripplanning.ItineraryBean

  }

  private ItineraryBean getPathAsItinerary(GraphPath path,
      OBATraverseOptions options) {

    ItineraryBean itinerary = new ItineraryBean();

    State startState = path.states.getFirst();
    State endState = path.states.getLast();

    itinerary.setStartTime(startState.getTime());
    itinerary.setEndTime(endState.getTime());

    List<LegBean> legs = new ArrayList<LegBean>();
    itinerary.setLegs(legs);

    /**
     * We set the current state index to 1, skipping the first state, since it
     * has no back edge
     */
 
View Full Code Here

Examples of org.onebusaway.transit_data.model.tripplanning.ItineraryBean

      GraphPath path = _itinerariesService.getWalkingItineraryBetweenStops(
          fromStop, toStop, new Date(timeFrom), options);

      if (path != null) {
        ItineraryBean walk = getPathAsItinerary(path, options);
        scaleItinerary(walk, timeFrom, timeTo);
        legs.addAll(walk.getLegs());
      }
    }
  }
View Full Code Here

Examples of org.onebusaway.transit_data.model.tripplanning.ItineraryBean

        if (path == null) {
          throw new IllegalStateException("expected walking path to exist");
        }

        ItineraryBean walkItinerary = getPathAsItinerary(path, options);
        legs.set(i, walkItinerary.getLegs().get(0));
      }
    }

    /**
     * Update the times
View Full Code Here

Examples of org.onebusaway.transit_data.model.tripplanning.ItineraryBean

    classMap.put("situationIds", String.class);
    config.setClassMap(classMap);

    JSONObject.toBean(jsonObject, bean, config);

    ItineraryBean itinerary = itineraryFactory.reverseItinerary(bean);
    constraints.setSelectedItinerary(itinerary);
  }
View Full Code Here

Examples of org.onebusaway.transit_data.model.tripplanning.ItineraryBean

  }

  public ItineraryBean reverseItinerary(ItineraryV2Bean bean) {
    if (bean == null)
      return null;
    ItineraryBean itinerary = new ItineraryBean();
    itinerary.setStartTime(bean.getStartTime());
    itinerary.setEndTime(bean.getEndTime());
    itinerary.setProbability(bean.getProbability());
    List<LegV2Bean> legBeans = bean.getLegs();
    if (!CollectionsLibrary.isEmpty(legBeans)) {
      List<LegBean> legs = new ArrayList<LegBean>();
      for (LegV2Bean legBean : legBeans) {
        LegBean leg = reverseLeg(legBean);
        legs.add(leg);
      }
      itinerary.setLegs(legs);
    }
    return itinerary;
  }
View Full Code Here

Examples of org.onebusaway.transit_data.model.tripplanning.ItineraryBean

    Grid grid = new Grid(trips.size(), 4);
    _panel.add(grid);

    for (int index = 0; index < trips.size(); index++) {
      ItineraryBean trip = trips.get(index);
      Date start = new Date(trip.getStartTime());
      Date end = new Date(trip.getEndTime());

      String timeStartAndEndLabel = _timeFormat.format(start) + " - "
          + _timeFormat.format(end);
      String durationLabel = TripBeanSupport.getDurationLabel(end.getTime()
          - start.getTime());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.