/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Author: Damian Waradzyn
*/
package com.mapmidlet.routing;
import java.util.Vector;
import com.mapmidlet.projection.WorldCoordinate;
/**
* Simplified route representation.
*
* @author Damian Waradzyn
*/
public class Route {
public long distance; // distance in meters
public Vector waypoints; // WorldCoordinates
public Vector routeDirections;
public static class RouteDirection {
public int offset; // waypoint
public String text;
public String turn;
public String distanceText;
}
public void print() {
System.out.println("distance=" + distance + "");
System.out.println("waypoints:");
for (int i = 0; i < waypoints.size(); i++) {
WorldCoordinate c = (WorldCoordinate) waypoints.elementAt(i);
System.out.println(" lat=" + c.latitude + ", lon=" + c.longitude);
}
System.out.println("route directions:");
for (int i = 0; i < routeDirections.size(); i++) {
RouteDirection d = (RouteDirection) routeDirections.elementAt(i);
System.out.println(" offset=" + d.offset + ", text=" + d.text + ", turn=" + d.turn + ", distanceText="
+ d.distanceText);
}
}
}