All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JBMSTours.serializabletypes.OneStopFlight

java.lang.Object
   |
   +----JBMSTours.serializabletypes.Flight
           |
           +----JBMSTours.serializabletypes.OneStopFlight

public class OneStopFlight
extends Flight
implements Serializable
Look at the Source.

Definition of a flight with one stop.


Variable Index

 o insert_stop_flight_bookings
 o segment2Number
 o stop_airport
 o stopArriveTime
 o stopDepartTime

Constructor Index

 o OneStopFlight()
Default niladic constructor for a flight with one stop.
 o OneStopFlight(Flight, Flight)
Constructs a one-stop flight from its two legs.

Method Index

 o checkSegmentAvailability(Connection, Date, short, int)
Checks whether the flight is available on the specified date for the specified number of seats.
 o getAltFlightId()
Get the flight id of the second leg.
 o getAltSegmentNumber()
Get the segment number of the second leg of this Flight.
 o getLayoverTime()
Get the duration, in hours, of the layover.
 o getTotalDuration()
Get the Total Duration of the flight, including layover Time
 o getType()
Get the flight type.
 o getUniqueId()
 o prepareStatements(Connection)
Prepares the PreparedStatements for this class.
 o storeBookingInfoForAirline(Connection, int, Date, int, BigDecimal, short)
"Books" the flight by extracting the pertinent information to a separate table (FlightBookings).
 o toString()
Prints out this object.

Variables

 o segment2Number
 public int segment2Number
 o stop_airport
 public String stop_airport
 o stopArriveTime
 public Time stopArriveTime
 o stopDepartTime
 public Time stopDepartTime
 o insert_stop_flight_bookings
 public transient PreparedStatement insert_stop_flight_bookings

Constructors

 o OneStopFlight
 public OneStopFlight()
Default niladic constructor for a flight with one stop.

 o OneStopFlight
 public OneStopFlight(Flight segone,
                      Flight segtwo)
Constructs a one-stop flight from its two legs.

Parameters:
segone - Flight object for first flight.
segtwo - Flight object for second flight.

Methods

 o toString
 public String toString()
Prints out this object.

Overrides:
toString in class Flight
 o getAltSegmentNumber
 public int getAltSegmentNumber()
Get the segment number of the second leg of this Flight.

Returns:
segment number of the second leg of this Flight.
Overrides:
getAltSegmentNumber in class Flight
 o getLayoverTime
 public double getLayoverTime()
Get the duration, in hours, of the layover.

Returns:
the duration, in hours, of the layover.
 o getAltFlightId
 public String getAltFlightId()
Get the flight id of the second leg.

Returns:
flight id of the second leg.
Overrides:
getAltFlightId in class Flight
 o getTotalDuration
 public double getTotalDuration()
Get the Total Duration of the flight, including layover Time

Returns:
flight's duration.
Overrides:
getTotalDuration in class Flight
 o getType
 public String getType()
Get the flight type.

Returns:
flight type.
Overrides:
getType in class Flight
 o getUniqueId
 public String getUniqueId()
Overrides:
getUniqueId in class Flight
 o storeBookingInfoForAirline
 public int storeBookingInfoForAirline(Connection conn,
                                       int gid,
                                       Date travelDate,
                                       int numberSeats,
                                       BigDecimal fixedRate,
                                       short level) throws SQLException
"Books" the flight by extracting the pertinent information to a separate table (FlightBookings). This is the information that eventually goes to the airline.

Parameters:
conn - Connection
gid - The group_id
travelDate - Date that travel begins.
numberSeats - number of seats reserved
fixedRate - the rate for those seats
The - level of the tour. See the static variables in Tour.java.
Returns:
> 0 if FlightBookings table successfully updated.
Throws: SQLException
in case anything goes wrong during a SQL operation
Overrides:
storeBookingInfoForAirline in class Flight
 o checkSegmentAvailability
 public boolean checkSegmentAvailability(Connection conn,
                                         Date travel,
                                         short kindOfSeats,
                                         int numberOfSeatsNeeded) throws SQLException
Checks whether the flight is available on the specified date for the specified number of seats. Called by CustomerFlight.checkAvailability().

Parameters:
conn - Connection
travel - The date flying.
kindOfSeats - the name of the column in FlightAvailability to select from
numberSeatsNeeded - number of seats needed
Returns:
true, if the flight is available
Throws: SQLException
in case anything goes wrong during a SQL operation
Overrides:
checkSegmentAvailability in class Flight
 o prepareStatements
 public boolean prepareStatements(Connection conn) throws SQLException
Prepares the PreparedStatements for this class.

Returns:
boolean if statements are prepared without error
Throws: SQLException
If there is a SQL error
Overrides:
prepareStatements in class Flight

All Packages  Class Hierarchy  This Package  Previous  Next  Index