-
Notifications
You must be signed in to change notification settings - Fork 1
/
ReservationInfo.java
50 lines (40 loc) · 1.27 KB
/
ReservationInfo.java
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
45
46
47
48
49
50
import java.io.Serializable;
import java.util.List;
public class ReservationInfo implements Serializable {
private List<Passenger> passengers;
private String airlineName;
private int maxNumSeats;
private int takenSeats;
public ReservationInfo(List<Passenger> passengers, String airlineName) {
this.passengers = passengers;
this.airlineName = airlineName;
}
public List<Passenger> getPassengers() {
return passengers;
}
public int getMaxNumSeats() {
return maxNumSeats;
}
public void setMaxNumSeats(int maxNumSeats) {
this.maxNumSeats = maxNumSeats;
}
public int getTakenSeats() {
return takenSeats;
}
public void setTakenSeats(int takenSeats) {
this.takenSeats = takenSeats;
}
public String getAirlineName() {
return airlineName;
}
public String toString() {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < passengers.size(); i++) {
Passenger passenger = passengers.get(i);
sb.append(passenger.toString() + "\n");
}
//sb.append("Maximum number of seats " + maxNumSeats + "\n");
//sb.append("Num of Taken seats " + takenSeats + "\n");
return sb.toString();
}
}