Class DraftFlightReport

All Implemented Interfaces:
Serializable, Comparable<Object>, AuthoredBean, CalendarEntry, FlightData, FlightNumber, IDBean, FlightTimes, RoutePair, ViewEntry, Cacheable

public class DraftFlightReport extends FlightReport implements FlightTimes
A class to store draft Flight Report data, with scheduled departure/arrival times.
Since:
2.8
Version:
11.5
Author:
Luke
See Also:
  • Constructor Details

    • DraftFlightReport

      public DraftFlightReport(Flight f)
      Creates a new Flight Report object with a given Flight.
      Parameters:
      f - the Flight bean
    • DraftFlightReport

      public DraftFlightReport(Airline a, int flightNumber, int leg)
      Creates a new Flight Report object with a given flight.
      Parameters:
      a - the Airline
      flightNumber - the Flight Number
      leg - the Leg Number
      Throws:
      NullPointerException - if the Airline Code is null
      IllegalArgumentException - if the Flight Report is zero or negative
      IllegalArgumentException - if the Leg is less than 1 or greater than 5
  • Method Details

    • getTimeD

      public ZonedDateTime getTimeD()
      Returns the scheduled departure time in local time. The date portion should be ignored.
      Specified by:
      getTimeD in interface FlightTimes
      Returns:
      the departure date/time
      See Also:
    • getTimeA

      public ZonedDateTime getTimeA()
      Returns the scheduled arrival time in local time. The date portion should be ignored.
      Specified by:
      getTimeA in interface FlightTimes
      Returns:
      the arrival date/time
      See Also:
    • getAltitude

      public String getAltitude()
      Returns the planned altitude.
      Returns:
      the altitude
    • getGateD

      public String getGateD()
      Returns the departure Gate name.
      Returns:
      the name or null if not defined
    • getGateA

      public String getGateA()
      Returns the arrival Gate name.
      Returns:
      the name or null if not defined
    • hasGates

      public boolean hasGates()
      Returns whether the flight has departure and arrival gates assigned.
      Returns:
      TRUE if departure and arrival gates are assigned, otherwise FALSE
    • setTimeD

      public void setTimeD(LocalDateTime dt)
      Updates the scheduled departure time in local time. The date portion should be ignored.
      Parameters:
      dt - the departure date/time
    • setTimeA

      public void setTimeA(LocalDateTime dt)
      Updates the scheduled arrival time in local time. The date portion should be ignored.
      Parameters:
      dt - the arrival date/time
    • setGateD

      public void setGateD(String name)
      Updates the departure Gate name.
      Parameters:
      name - the Gate name or null if not defined
    • setGateA

      public void setGateA(String name)
      Updates the arrival Gate name.
      Parameters:
      name - the Gate name or null if not defined
    • setAltitude

      public void setAltitude(String alt)
      Updates the planned altitude.
      Parameters:
      alt - the altitude
    • getDraftComments

      public String getDraftComments()
      Returns default comments with departure and arrival times.
      Returns:
      the comments
    • getDuration

      public Duration getDuration()
      Description copied from class: Flight
      A method to return the exact length of the flight.
      Overrides:
      getDuration in class FlightReport
      Returns:
      a Duration