|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object airline.Flight.Ticket
public class Flight.Ticket
For each passenger on the flight, there is an underlying Ticket
that is used to track the seating assignment for the passenger on the flight
as well as to trace this passenger back to an original Reservation
.
Method Summary | |
---|---|
void |
cancel()
Officially removes the underlying traveler from the given flight. |
Flight |
getFlight()
Returns a reference to the associated Flight . |
String |
getSeat()
Returns the string representation of the seat (e.g., "28C"). |
String |
getTravelerName()
Returns the name of the traveler for this ticket. |
boolean |
requestSeatChange(String seatDesignator)
Requests a seat change from the existing assignment to the designated seat. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void cancel() throws IllegalArgumentException
IllegalArgumentException
- if the Ticket
was invalid (for example, if previously removed from flight)public Flight getFlight()
Flight
.
Flight
instance.public String getSeat()
public String getTravelerName()
public boolean requestSeatChange(String seatDesignator) throws IllegalArgumentException
seatDesignator
- String representation for desired seat (e.g., "28C")
true
if request accepted; false
otherwise (e.g., if that seat is unavailable)
IllegalArgumentException
- if seatDesignator
is invalid for the flight's seating configuration.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |