|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object airline.Reservation
public class Reservation
A Reservation
manages an itinerary of one or more flights
for a traveling party.
Method Summary | |
---|---|
void |
cancel()
Cancels all tickets associated with this reservation. |
Iterator<Flight> |
getAllLegs()
Returns an Iterator reporting all flights for this reservation. |
Iterator<String> |
getAllTravelerNames()
Returns an Iterator reporting names of all travelers on this reservation. |
Customer |
getBooker()
Returns the Customer who booked the reservation. |
Flight |
getLeg(int index)
Returns the Flight with the given index. |
String |
getLocator()
Return the record locator for this reservation. |
int |
getNumLegs()
Returns the number of flight legs booked on this reservation. |
int |
getNumTravelers()
Returns the number of travelers booked on this reservation. |
Flight.Ticket |
getTicket(int travIndex,
int legIndex)
Returns the ticket for the given traveler on the given leg of the reservation. |
String |
getTravelerName(int index)
Returns the name of the traveler with given index. |
boolean |
isPurchased()
Determines if the given reservation was formally purchased. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void cancel()
public Iterator<Flight> getAllLegs()
Iterator
reporting all flights for this reservation.
Iterator
of Flight
instances.public Iterator<String> getAllTravelerNames()
Iterator
reporting names of all travelers on this reservation.
Iterator
of traveler names.public Customer getBooker()
Customer
who booked the reservation.
public Flight getLeg(int index)
Flight
with the given index.
index
- Legs of the reservation are zero-indexed
Flight
public String getLocator()
String
locator.public int getNumLegs()
public int getNumTravelers()
public Flight.Ticket getTicket(int travIndex, int legIndex) throws IllegalStateException
null
if unticketed.
travIndex
- Traveler names are zero-indexed starting with booking Customer.legIndex
- Flight legs are zero-indexed.
Flight.Ticket
instance.
IllegalStateException
- if the reservation was never purchased.public String getTravelerName(int index)
index
- Travelers are zero-indexed
public boolean isPurchased()
true
if purchased; false
otherwise;
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |