COnnected maps to airlines, Airports and ROutes

This commit is contained in:
YaFedImYaEatIm
2016-09-17 20:06:19 +12:00
parent 44ed68ee7a
commit 5363cf8b4e
12 changed files with 114 additions and 7 deletions
@@ -365,7 +365,7 @@ public class Airport {
return distance;
}
public void hasDuplicate(Airport airport) throws DataException{
if (!airport.getName().equals("") && airport.getName().equals(this.name)){
if (airport.getName().equals("") || airport.getName().equals(this.name)){
throw new DataException("Airport Name already Exists, Please Choose Another.");
}
if (!airport.getIATA_FFA().equals("") && airport.getIATA_FFA().equals(this.name)){
@@ -6,6 +6,7 @@ public class Country {
private String DST, name;
private ArrayList<City> cities = new ArrayList<City>();
private ArrayList<Airline> airlines = new ArrayList<Airline>();
private Position position;
public Country(String DST, String name){
this.DST = DST;
@@ -81,4 +82,16 @@ public class Country {
public void delCities(int index){
this.cities.remove(index);
}
public ArrayList<City> getCities() {
return cities;
}
public Position getPosition() {
return position;
}
public void setPosition(Position position) {
this.position = position;
}
}