Package org.onebusaway.api.model.transit.tripplanning

Examples of org.onebusaway.api.model.transit.tripplanning.LegV2Bean


    List<LegBean> legs = itinerary.getLegs();
    if (!CollectionsLibrary.isEmpty(legs)) {
      List<LegV2Bean> legBeans = new ArrayList<LegV2Bean>(legs.size());
      for (LegBean leg : legs) {
        LegV2Bean legBean = getLeg(leg);
        legBeans.add(legBean);
      }
      bean.setLegs(legBeans);
    }
View Full Code Here


    return itinerary;
  }

  public LegV2Bean getLeg(LegBean leg) {

    LegV2Bean bean = new LegV2Bean();

    bean.setStartTime(leg.getStartTime());
    bean.setEndTime(leg.getEndTime());
    bean.setFrom(_factory.getPoint(leg.getFrom()));
    bean.setTo(_factory.getPoint(leg.getTo()));
    bean.setDistance(leg.getDistance());
    bean.setMode(leg.getMode());

    TransitLegBean transitLeg = leg.getTransitLeg();
    if (transitLeg != null) {
      TransitLegV2Bean transitLegBean = getTransitLeg(transitLeg);
      bean.setTransitLeg(transitLegBean);
    }

    List<StreetLegBean> streetLegs = leg.getStreetLegs();
    if (!CollectionsLibrary.isEmpty(streetLegs)) {
      List<StreetLegV2Bean> streetLegBeans = new ArrayList<StreetLegV2Bean>();
      for (StreetLegBean streetLeg : streetLegs) {
        StreetLegV2Bean streetLegBean = getStreetLeg(streetLeg);
        streetLegBeans.add(streetLegBean);
      }
      bean.setStreetLegs(streetLegBeans);
    }

    return bean;
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.api.model.transit.tripplanning.LegV2Bean

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.