Class ScheduleEntry

All Implemented Interfaces:
Serializable, Comparable<Object>, FlightNumber, IDBean, FlightTimes, RoutePair, ViewEntry, Cacheable
Direct Known Subclasses:
RawScheduleEntry, ScheduleSearchEntry

public class ScheduleEntry extends Flight implements FlightTimes, ViewEntry
A class to store Schedule Entry information.
Since:
1.0
Version:
11.6
Author:
Luke
See Also:
  • Field Details

    • EQ_VARIES

      public static final String EQ_VARIES
      Variable equipment code.
      See Also:
    • _arrivalPlusDays

      protected int _arrivalPlusDays
      Adjusts the arrival date/time forward by a certain number of days.
  • Constructor Details

  • Method Details

    • isVariable

      public static boolean isVariable(Flight f)
      Helper method to determine if flight is using a variable equipment type.
      Parameters:
      f - a Flight
      Returns:
      TRUE if equipment varies, otherwise FALSE
      See Also:
    • getLength

      public final int getLength()
      Returns the length of the flight, in hours multiplied by 10.
      Specified by:
      getLength in class Flight
      Returns:
      the length of the flight
      Throws:
      IllegalStateException - if departure or arrival times are not set
      See Also:
    • getDuration

      public final Duration getDuration()
      Description copied from class: Flight
      A method to return the exact length of the flight.
      Specified by:
      getDuration in class Flight
      Returns:
      a Duration
    • getTimeD

      public ZonedDateTime getTimeD()
      Description copied from interface: FlightTimes
      Returns the departure time of the flight, with full timezone information. The date component of this value can be ignored, but may contain significant information like the flight date or the effective date for a schedule entry.
      Specified by:
      getTimeD in interface FlightTimes
      Returns:
      the full departure time of the flight
      See Also:
    • getTimeA

      public ZonedDateTime getTimeA()
      Description copied from interface: FlightTimes
      Returns the arrival time of the flight, with full timezone information. The date component of this value can be ignored, but may contain significant information.
      Specified by:
      getTimeA in interface FlightTimes
      Returns:
      the full arrival time of the flight
      See Also:
    • getID

      public final int getID()
      Returns the database ID of the schedule entry. NOT IMPLEMENTED
      Specified by:
      getID in interface IDBean
      Overrides:
      getID in class DatabaseBean
      Returns:
      the database ID
      Throws:
      UnsupportedOperationException - always
    • getHistoric

      public boolean getHistoric()
      Returns the "historic flight" flag value for this flight.
      Returns:
      TRUE if this is a historic flight, FALSE otherwise
      See Also:
    • getAcademy

      public boolean getAcademy()
      Returns if this flight is part of the Flight Academy.
      Returns:
      TRUE if the flight is part of the Flight Academy, otherwise FALSE
      See Also:
    • getHasDSTAdjustment

      public boolean getHasDSTAdjustment()
      Returns whether the arrival time has been adjusted for DST changes between the effective date of this Schedule Entry and the current date.
      Returns:
      TRUE if the arrival time has been adjusted, otherwise FALSE
      See Also:
    • getCodeShare

      public String getCodeShare()
      If a codeshare, the flight code of the operator's flight.
      Returns:
      the flight code, or null if none
    • getSource

      public ScheduleSource getSource()
      Returns the original source of this Schedule Entry.
      Returns:
      the ScheduleSource, or null
    • getArrivalPlusDays

      public int getArrivalPlusDays()
      Returns the number of days forward to adjust the arrival time.
      Returns:
      the number of days
    • getRemarks

      public String getRemarks()
      Returns any operator notes for this flight.
      Returns:
      the remarks
    • setID

      public final void setID(int id)
      Sets the database ID of this schedule entry. NOT IMPLEMENTED
      Overrides:
      setID in class DatabaseBean
      Parameters:
      id - The primary key of the entry in the database that corresponds to this object.
      Throws:
      UnsupportedOperationException - always
      See Also:
    • adjustForDST

      public boolean adjustForDST(LocalDate dt)
      Adjusts the arrival time if the DST offsets for either Airport have changed from the effective date of this schedule etnry.
      Parameters:
      dt - the current date
      Returns:
      TRUE if the arrival time has been adjusted, otherwise FALSE
    • setTimeD

      public void setTimeD(LocalDateTime dt)
      Sets the departure time for this flight.
      Parameters:
      dt - the departure time of the flight
      Throws:
      NullPointerException - if the departure airport is not set
      See Also:
    • setTimeA

      public void setTimeA(LocalDateTime dt)
      Sets the arrival time for this flight.
      Parameters:
      dt - the arrival time of the flight in local time
      Throws:
      NullPointerException - if the arrival airport is not set
      See Also:
    • setLength

      public void setLength(int len)
      Sets the length of a flight leg.
      Parameters:
      len - the length of a leg, in hours mulitiplied by ten.
      See Also:
    • setHistoric

      public void setHistoric(boolean historic)
      Updates this Schedule entry's "historic flight" flag.
      Parameters:
      historic - the new "historic flight" flag value
      See Also:
    • setAcademy

      public void setAcademy(boolean academy)
      Updates this Schedule entry's "Flight Academy flight" flag.
      Parameters:
      academy - TRUE if the Flight is part of the Academy, otherwise FALSE
      See Also:
    • setCodeShare

      public void setCodeShare(String flightCode)
      If this is a codeshare flight, the flight code of the operator's flight.
      Parameters:
      flightCode - the flight code
    • setRemarks

      public void setRemarks(String remarks)
      Updates any notes (usually about codehsare operator) for this flight.
      Parameters:
      remarks - the remarks
    • setSource

      public void setSource(ScheduleSource src)
      Updates the source of this entry.
      Parameters:
      src - the ScheduleSource
    • getRowClassName

      public String getRowClassName()
      Description copied from interface: ViewEntry
      Returns the CSS class for this object if rendered in a view table.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name, or NULL if none
    • toString

      public String toString()
      Overrides:
      toString in class Flight
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Flight