Exemple #1
0
        public Boolean routeInContainsLocation(Location location) {

            foreach (Location loc in routeIn) {
                if (loc.getName().Equals(location.getName())) {
                    return true;
                }
            }
            return false;
        }
Exemple #2
0
        //Add the data into the data structures
        public static Route processInput(String temp, Route route) {
            Location location = null;
            String[] tempLocations = temp.Split(',');

            //fill the dictionarires for routes and locations
            foreach (String s in tempLocations) {
                if (!locations.ContainsKey(s)) {
                    location = new Location(s);
                    route.addLocationToRouteIn(location);
                    locations.Add(s, location);
                } else {
                    Location value;
                    if (locations.TryGetValue(s, out value)) {
                        route.addLocationToRouteIn(locations[s]);
                    }
                }
            }
            return route;
        }
Exemple #3
0
 public void addLocationToRouteOut(Location location) {
     routeOut.AddLast(location);
     location.addRoute(this);
 }