reservations
Interface Itinerary


public interface Itinerary

This interface is used to represent airline flight starting and destination cities and departure times. It is also used in the case of Reservation Requests to represent a passenger's desired starting and destination airports.


Method Summary
 boolean equals(java.lang.Object o)
          The result is true if and only if the argument is not null and is an Itinerary object that represents the same Itinerary as this Itinerary object.
 java.util.Date getDepartureTime()
          Returns the itinerary departure time, null in the case of reservation request itineraries
 Airport getDestinationAirport()
          Returns the destination airport
 Airport getStartingAirport()
          Returns the starting airport
 int hashCode()
          Returns a hashcode for this Itinerary such that two Itinerary objects with the same starting and destination airports will have the same hashcode value.
 void register(Flight f)
          Is used for a Flight object to register itself with an Itinerary it corresponds to.
 

Method Detail

getStartingAirport

public Airport getStartingAirport()
Returns the starting airport


getDestinationAirport

public Airport getDestinationAirport()
Returns the destination airport


getDepartureTime

public java.util.Date getDepartureTime()
Returns the itinerary departure time, null in the case of reservation request itineraries


hashCode

public int hashCode()
Returns a hashcode for this Itinerary such that two Itinerary objects with the same starting and destination airports will have the same hashcode value.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
The result is true if and only if the argument is not null and is an Itinerary object that represents the same Itinerary as this Itinerary object. Note that Itinerary equality does not include comparison of the Itinerary departure time; only that the starting and destination airports are the same.

Overrides:
equals in class java.lang.Object

register

public void register(Flight f)
Is used for a Flight object to register itself with an Itinerary it corresponds to. It is required that you register a Flight object with an Itinerary before you can invoke any of the Itinerary's methods. ReservationRequest Itinerary objects do not perform this check.