String routeId = transRoute.getUID().toString();
UID routeId = transRoute.getUID();
  public static String registerRoute(      Registry toReg,      TransportationRoute transRoute) {    String routeId = transRoute.getUID().toString();    if (toReg.routes.getRoute(routeId) == null) {      // must register this route      //      // create a new route      Route toRoute = new Route();      toRoute.setUID(routeId);      // get links of route      Vector routeLinks = transRoute.getLinks();      int nRouteLinks =         ((routeLinks != null) ? routeLinks.size() : 0);      if (nRouteLinks < 2) {        // invalid route?        return null;      }      // register the locations      int i = 0;      while (true) {        // get start and stop locations        TransportationLink transLink =          (TransportationLink)routeLinks.elementAt(i);        GeolocLocation startLoc =          transLink.getOrigin().getGeolocLocation();        toRoute.addSegmentLocID(            registerLocation(toReg, startLoc));        if (++i >= nRouteLinks) {          // register the end location          GeolocLocation endLoc =            transLink.getDestination().getGeolocLocation();          toRoute.addSegmentLocID(              registerLocation(toReg, endLoc));          break;        }      }      // register the cargo "instance" prototype      toReg.routes.addRoute(toRoute);    }    // return the route id    return routeId;  }