Package net.sf.myway.gps.datatypes

Examples of net.sf.myway.gps.datatypes.Route


   * @see net.sf.myway.gps.garmin.protocol.ResultBuilder#buildResult(java.lang.Object[])
   */
  @Override
  public Object buildResult(final Object[] raw) {
    final List<Route> routes = new ArrayList<Route>();
    Route t = null;
    for (final Object element : raw)
      if (element instanceof RouteHeader) {
        t = new Route((RouteHeader) element);
        routes.add(t);
      }
      else if (element instanceof Waypoint)
        t.add((Waypoint) element);
      else if (element instanceof RouteLink)
        t.add((RouteLink) element);
    return routes;
  }
View Full Code Here


      for (final Object element : r)
        if (element instanceof RouteHeader)
          anzHeader++;
      // 2. Durchgang: Routes bauen
      final Route[] routes = new Route[anzHeader];
      Route t = null;
      List<Waypoint> waypoints = null;
      List<RouteLink> links = null;
      i = 0;
      for (final Object element : r)
        if (element instanceof RouteHeader) {
          if (t != null) {
            t.setWaypoints(waypoints);
            if (links.size() > 0)
              t.setLinks(links);
          }
          t = new Route((RouteHeader) element);
          routes[i++] = t;
          waypoints = new ArrayList<Waypoint>();
          links = new ArrayList<RouteLink>();
        }
        else if (element instanceof Waypoint)
          waypoints.add((Waypoint) element);
        else if (element instanceof RouteLink)
          links.add((RouteLink) element);
      if (t != null) {
        t.setWaypoints(waypoints);
        if (links.size() > 0)
          t.setLinks(links);
      }
      return routes;
    }
    else
      return r;
View Full Code Here

TOP

Related Classes of net.sf.myway.gps.datatypes.Route

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.