2 * This class is used to store as edges in a graph.
4 * @author Anton Johansson <anton.johansson@gmail.com>
9 private double distance
;
10 private double travelTime
;
13 * Creates a new Road instance.
15 * @param speed The speed of this Road.
16 * @param distance The distance of this Road.
18 public Road(int speed
, double distance
) {
20 this.distance
= distance
;
21 this.travelTime
= distance
/ (speed
/* 3.6*/);
25 * Gets the value of speed
27 * @return the value of speed
29 public final int getSpeed() {
34 * Gets the value of distance
36 * @return the value of distance
38 public final double getDistance() {
43 * Gets the value of travelTime
45 * @return the value of travelTime
47 public final double getTravelTime() {
48 return this.travelTime
;
52 * Returns a String-representation of this Road. The String value
53 * of travelTime is returned.
55 * @return The String value of this Road.
57 public String
toString() {
58 return new Double(this.travelTime
).toString();