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.
-
insert_stop_flight_bookings
-
-
segment2Number
-
-
stop_airport
-
-
stopArriveTime
-
-
stopDepartTime
-
-
OneStopFlight()
- Default niladic constructor for a flight with one stop.
-
OneStopFlight(Flight, Flight)
- Constructs a one-stop flight from its two legs.
-
checkSegmentAvailability(Connection, Date, short, int)
- Checks whether the flight is available on the specified date for the specified
number of seats.
-
getAltFlightId()
- Get the flight id of the second leg.
-
getAltSegmentNumber()
- Get the segment number of the second leg of this Flight.
-
getLayoverTime()
- Get the duration, in hours, of the layover.
-
getTotalDuration()
- Get the Total Duration of the flight, including layover Time
-
getType()
- Get the flight type.
-
getUniqueId()
-
-
prepareStatements(Connection)
- Prepares the PreparedStatements for this class.
-
storeBookingInfoForAirline(Connection, int, Date, int, BigDecimal, short)
- "Books" the flight by extracting the pertinent information to
a separate table (FlightBookings).
-
toString()
- Prints out this object.
segment2Number
public int segment2Number
stop_airport
public String stop_airport
stopArriveTime
public Time stopArriveTime
stopDepartTime
public Time stopDepartTime
insert_stop_flight_bookings
public transient PreparedStatement insert_stop_flight_bookings
OneStopFlight
public OneStopFlight()
- Default niladic constructor for a flight with one stop.
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.
toString
public String toString()
- Prints out this object.
- Overrides:
- toString in class Flight
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
getLayoverTime
public double getLayoverTime()
- Get the duration, in hours, of the layover.
- Returns:
- the duration, in hours, of the layover.
getAltFlightId
public String getAltFlightId()
- Get the flight id of the second leg.
- Returns:
- flight id of the second leg.
- Overrides:
- getAltFlightId in class Flight
getTotalDuration
public double getTotalDuration()
- Get the Total Duration of the flight, including layover Time
- Returns:
- flight's duration.
- Overrides:
- getTotalDuration in class Flight
getType
public String getType()
- Get the flight type.
- Returns:
- flight type.
- Overrides:
- getType in class Flight
getUniqueId
public String getUniqueId()
- Overrides:
- getUniqueId in class Flight
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
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
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