public Route copyRoute(Route route,String routeName,boolean invert){
  Route newRoute=newRoute(routeName);
  List<RouteLocation> routeList=route.getLocationsBySequenceList();
  if (!invert) {
    for (    RouteLocation rl : routeList) {
      copyRouteLocation(newRoute,rl,null,invert);
    }
  }
 else {
    for (int i=routeList.size() - 1; i >= 0; i--) {
      int y=i - 1;
      if (y < 0) {
        y=0;
      }
      copyRouteLocation(newRoute,routeList.get(i),routeList.get(y),invert);
    }
  }
  newRoute.setComment(route.getComment());
  return newRoute;
}

public Route copyRoute ( Route route , String routeName , boolean invert ) { Route newRoute = newRoute ( routeName ) ; List < RouteLocation > routeList = route . getLocationsBySequenceList ( ) ; if ( ! invert ) { for ( RouteLocation rl : routeList ) { copyRouteLocation ( newRoute , rl , null , invert ) ; } } else { for ( int i = routeList . size ( ) - 1 ; i >= 0 ; i -- ) { int y = i - 1 ; if ( y < 0 ) { y = 0 ; } copyRouteLocation ( newRoute , routeList . get ( i ) , routeList . get ( y ) , invert ) ; } } newRoute . setComment ( route . getComment ( ) ) ; return newRoute ; }
copy route , returns a new route named routename . if invert is true the reverse of the route is returned .
