-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathFlight.java
More file actions
44 lines (31 loc) · 1.19 KB
/
Copy pathFlight.java
File metadata and controls
44 lines (31 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
public class Flight implements Comparable<Flight> {
//instant variables
private String flightCode; //Flight Code
private String destination; //Destination of Flight
private String carrier; //Flight's Carrier Name
private int passCap; //Maximum Capacity of Passengers in each flight
private double bagWeightCap; //Maximum Capacity of Passengers' baggage weight
private double bagVolCap; //Maximum Capacity of Passengers' baggage volume
//Constructor
public Flight(String fc, String d, String c, int pCap, double bWCap, double bVCap)
{
flightCode = fc;
destination = d;
carrier = c;
passCap = pCap;
bagWeightCap = bWCap;
bagVolCap = bVCap;
}
//used for TreeSets
public int compareTo(Flight other) {
String thisFlight = flightCode;
return thisFlight.compareTo(other.getFlightCode());
}
//Get Value
public String getFlightCode() { return flightCode;}
public String getDestination() {return destination;}
public String getCarrier() {return carrier;}
public int getPassCap() {return passCap;}
public double getBagWeightCap() {return bagWeightCap;}
public double getBagVolCap() {return bagVolCap;}
}