Class ScheduleSourceInfo

java.lang.Object
org.deltava.beans.schedule.ScheduleSourceInfo
All Implemented Interfaces:
Serializable, Comparable<Object>, CalendarEntry, ComboAlias, Cacheable
Direct Known Subclasses:
ScheduleSourceHistory

public class ScheduleSourceInfo extends Object implements ComboAlias, Cacheable, CalendarEntry
A bean to store raw schedule statistics data.
Since:
9.0
Version:
10.5
Author:
Luke
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    The number of flight legs adjusted for DST.
    protected int
    The number of skipped flight legs.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    Creates the bean.
    protected
    Creates the bean from an existing ScheduleSourceInfo bean.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addLegs(Airline a, int legs)
    Updates the number of flight legs for a particular Airline.
    void
    Increments the number flight legs with adjusted arrival times for this source.
    Returns the cache key for this object.
    int
     
    boolean
    Returns whether this schedule source includes a particular airline.
    boolean
    Returns if the schedule import is currently active.
    int
    Returns the number of flight legs with adjusted arrival times (for DST) in the last import.
    Returns the Airlines loaded from this schedule source.
    boolean
    Returns whether this schedule import was an automatic import.
    Returns the base schedule effective date, tied to the Monday of the week of the effective date, if not current.
    Returns the alias to use in the HTML <OPTION> element.
    Returns the visible name to use in the HTML <OPTION> element.
    Returns this entry's date for ordering in the Calendar.
    Returns the effective date of the last schedule filter using this source.
    boolean
    Returns whether this is a current schedule import.
    int
    Returns the total number of flight legs from this source.
    int
    Returns the number of flight legs for a particular Airline from this source.
    int
    Returns the maximum imported line number for this source.
    Returns the date to be used if filtering flights from this source today.
    Converts the airline/leg information into a set of Combobox/Checkbox options.
    boolean
    Returns whether this source was purged during the current import.
    int
    Returns the number of skipped flight legs in the last import.
    Returns the schedule source.
    int
     
    void
    setActive(boolean isActive)
    Sets if the schedule import is currently active.
    void
    Updates the Airlines for this source.
    void
    setAutoImport(boolean isAuto)
    Sets the last import as an automatic schedule import.
    void
    Updates the effective date of the last schedule filter using this source.
    void
    Updates the date of the last schedule filter using this source.
    void
    Updates the maximum imported line number for this source.
    void
    setPurged(boolean isPurged)
    Updates whether this source was purged during the current import.
    void
    Increments the number of skipped flight legs for this source.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • _skipped

      protected int _skipped
      The number of skipped flight legs.
    • _adjusted

      protected int _adjusted
      The number of flight legs adjusted for DST.
  • Constructor Details

    • ScheduleSourceInfo

      public ScheduleSourceInfo(ScheduleSource src)
      Creates the bean.
      Parameters:
      src - the ScheduleSource
    • ScheduleSourceInfo

      protected ScheduleSourceInfo(ScheduleSourceInfo inf)
      Creates the bean from an existing ScheduleSourceInfo bean.
      Parameters:
      inf - the ScheduleSourceInfo
  • Method Details

    • getSource

      public ScheduleSource getSource()
      Returns the schedule source.
      Returns:
      the ScheduleSource
    • getEffectiveDate

      public LocalDate getEffectiveDate()
      Returns the effective date of the last schedule filter using this source.
      Returns:
      the effective date, or null
    • getDate

      public Instant getDate()
      Description copied from interface: CalendarEntry
      Returns this entry's date for ordering in the Calendar.
      Specified by:
      getDate in interface CalendarEntry
      Returns:
      the date/time
    • getAutoImport

      public boolean getAutoImport()
      Returns whether this schedule import was an automatic import.
      Returns:
      TRUE if automatic, otherwise FALSE
    • getActive

      public boolean getActive()
      Returns if the schedule import is currently active.
      Returns:
      TRUE if active, otherwise FALSE
    • getMaxLineNumber

      public int getMaxLineNumber()
      Returns the maximum imported line number for this source.
      Returns:
      the maximum line number
    • getLegs

      public int getLegs()
      Returns the total number of flight legs from this source.
      Returns:
      the number of legs
    • getAirlines

      public Collection<Airline> getAirlines()
      Returns the Airlines loaded from this schedule source.
      Returns:
      a Collection of Airline beans
    • getSkipped

      public int getSkipped()
      Returns the number of skipped flight legs in the last import.
      Returns:
      the number of legs
    • getAdjusted

      public int getAdjusted()
      Returns the number of flight legs with adjusted arrival times (for DST) in the last import.
      Returns:
      the number of legs
    • getPurged

      public boolean getPurged()
      Returns whether this source was purged during the current import.
      Returns:
      TRUE if purged, otherwise FALSE
    • contains

      public boolean contains(Airline a)
      Returns whether this schedule source includes a particular airline.
      Parameters:
      a - an Airline
      Returns:
      TRUE if included, otherwise FALSE
    • getLegs

      public int getLegs(Airline a)
      Returns the number of flight legs for a particular Airline from this source.
      Parameters:
      a - an Airline bean
      Returns:
      the number of legs
    • getOptions

      public Collection<ComboAlias> getOptions()
      Converts the airline/leg information into a set of Combobox/Checkbox options.
      Returns:
      a Collection of ComboAlias objects
    • getIsCurrent

      public boolean getIsCurrent()
      Returns whether this is a current schedule import.
      Returns:
      TRUE if the effective date is less than 72 hours in the past, otherwise FALSE
    • getBaseDate

      public LocalDate getBaseDate()
      Returns the base schedule effective date, tied to the Monday of the week of the effective date, if not current.
      Returns:
      the Monday at the start of the week, or the effective date if current
    • getNextImportDate

      public LocalDate getNextImportDate()
      Returns the date to be used if filtering flights from this source today.
      Returns:
      today is current or no previous import, otherwise the base date adjusted by the day of week
      See Also:
    • addLegs

      public void addLegs(Airline a, int legs)
      Updates the number of flight legs for a particular Airline.
      Parameters:
      a - the Airline
      legs - the number of legs
    • setAirlines

      public void setAirlines(Collection<Airline> airlines)
      Updates the Airlines for this source.
      Parameters:
      airlines - a Colleciton of Airlines
    • setEffectiveDate

      public void setEffectiveDate(Instant dt)
      Updates the effective date of the last schedule filter using this source.
      Parameters:
      dt - the effective date/time, the time will be discarded
    • setImportDate

      public void setImportDate(Instant dt)
      Updates the date of the last schedule filter using this source.
      Parameters:
      dt - the filter date/time
    • setAutoImport

      public void setAutoImport(boolean isAuto)
      Sets the last import as an automatic schedule import.
      Parameters:
      isAuto - TRUE if automatic, otherwise FALSE
    • setActive

      public void setActive(boolean isActive)
      Sets if the schedule import is currently active.
      Parameters:
      isActive - TRUE if active, otherwise FALSE
    • setMaxLineNumber

      public void setMaxLineNumber(int ln)
      Updates the maximum imported line number for this source.
      Parameters:
      ln - the line number
    • skip

      public void skip()
      Increments the number of skipped flight legs for this source.
    • adjust

      public void adjust()
      Increments the number flight legs with adjusted arrival times for this source.
    • setPurged

      public void setPurged(boolean isPurged)
      Updates whether this source was purged during the current import.
      Parameters:
      isPurged - TRUE if purged, otherwise FALSE
    • compareTo

      public int compareTo(Object o)
      Specified by:
      compareTo in interface Comparable<Object>
    • toString

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • cacheKey

      public Object cacheKey()
      Description copied from interface: Cacheable
      Returns the cache key for this object. Caches call this method when adding the object.
      Specified by:
      cacheKey in interface Cacheable
      Returns:
      the cache key for the object
    • getComboAlias

      public String getComboAlias()
      Description copied from interface: ComboAlias
      Returns the alias to use in the HTML <OPTION> element.
      Specified by:
      getComboAlias in interface ComboAlias
      Returns:
      The alias for this entry
    • getComboName

      public String getComboName()
      Description copied from interface: ComboAlias
      Returns the visible name to use in the HTML <OPTION> element.
      Specified by:
      getComboName in interface ComboAlias
      Returns:
      The visible name for this entry