diff --git a/src/MakkahCity.java b/src/MakkahCity.java index 11831f7..2f18c49 100644 --- a/src/MakkahCity.java +++ b/src/MakkahCity.java @@ -315,6 +315,8 @@ public class MakkahCity { },District.ALAZIZIYA, Mashier.MINA); //******Mina Leave end +// for (Route r : stdRoutes) +// System.out.println(r.toString()); } private static void fillBusesToList() { diff --git a/src/Route.java b/src/Route.java index d32c49e..d8b166b 100644 --- a/src/Route.java +++ b/src/Route.java @@ -42,6 +42,20 @@ public class Route { return result; } + public String toString() { + StringBuilder s = new StringBuilder(); + s.append(super.toString()) + .append("\n").append(String.format("%s:%s",getHotelArea().name(),getMashier().name())) + .append("\n") + .append("Length: ").append(getTotalLength()) + .append("\n") + .append("Streets: "); + for (Street street : this.getStreets()) + s.append(street.getName().name()).append(" "); + s.append("\nBest Time: ").append(getFastestTimeOfTravel(new Bus())).append("\n"); + return s.toString(); + } + public District getHotelArea() { return hotelArea; }