Fixed some refactoring issues and implemented delete functions in the GUI

This commit is contained in:
Sunguin Peng
2016-09-17 15:06:29 +12:00
parent e3ff9d3bfc
commit 5cc305d896
10 changed files with 73 additions and 33 deletions
+2 -2
View File
@@ -122,7 +122,7 @@ public class Route {
}
//JavaDoc needed
public int getAirlineID() throws DataException {
if (this.airline != null) {
if (this.getAirline() != null) {
return this.getAirline().getID();
}else {
return 0;
@@ -240,7 +240,7 @@ public class Route {
*/
public void hasDuplicate(Route route) throws DataException{
//routeAirline + routeSourceAirport + routeArrvAirport + routeCodeShare + routeStops + routeEquip
if (route.getAirline().equals(this.airline) && route.getDepartureAirport().equals(this.departureAirport)
if (route.getAirlineName().equals(this.airlineName) && route.getDepartureAirport().equals(this.departureAirport)
&& route.getArrivalAirport().equals(this.arrivalAirport) && route.getCode().equals(this.codeShare)
&& route.getStops() == this.stops && route.getEquipment().equals(this.equipment)){
throw new DataException("This Route already exists.");