COnnected maps to airlines, Airports and ROutes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user