Class ScheduleSourceInfo
java.lang.Object
org.deltava.beans.schedule.ScheduleSourceInfo
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,CalendarEntry
,ComboAlias
,Cacheable
- Direct Known Subclasses:
ScheduleSourceHistory
A bean to store raw schedule statistics data.
- Since:
- 9.0
- Version:
- 10.5
- Author:
- Luke
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates the bean.protected
Creates the bean from an existing ScheduleSourceInfo bean. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Updates the number of flight legs for a particular Airline.void
adjust()
Increments the number flight legs with adjusted arrival times for this source.cacheKey()
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.getDate()
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
getLegs()
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
hashCode()
void
setActive
(boolean isActive) Sets if the schedule import is currently active.void
setAirlines
(Collection<Airline> airlines) 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
setImportDate
(Instant dt) Updates the date of the last schedule filter using this source.void
setMaxLineNumber
(int ln) Updates the maximum imported line number for this source.void
setPurged
(boolean isPurged) Updates whether this source was purged during the current import.void
skip()
Increments the number of skipped flight legs for this source.toString()
-
Field Details
-
_skipped
protected int _skippedThe number of skipped flight legs. -
_adjusted
protected int _adjustedThe number of flight legs adjusted for DST.
-
-
Constructor Details
-
ScheduleSourceInfo
Creates the bean.- Parameters:
src
- the ScheduleSource
-
ScheduleSourceInfo
Creates the bean from an existing ScheduleSourceInfo bean.- Parameters:
inf
- the ScheduleSourceInfo
-
-
Method Details
-
getSource
-
getEffectiveDate
Returns the effective date of the last schedule filter using this source.- Returns:
- the effective date, or null
-
getDate
Description copied from interface:CalendarEntry
Returns this entry's date for ordering in the Calendar.- Specified by:
getDate
in interfaceCalendarEntry
- 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
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
Returns whether this schedule source includes a particular airline.- Parameters:
a
- an Airline- Returns:
- TRUE if included, otherwise FALSE
-
getLegs
Returns the number of flight legs for a particular Airline from this source.- Parameters:
a
- an Airline bean- Returns:
- the number of legs
-
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
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
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
Updates the number of flight legs for a particular Airline.- Parameters:
a
- the Airlinelegs
- the number of legs
-
setAirlines
Updates the Airlines for this source.- Parameters:
airlines
- a Colleciton of Airlines
-
setEffectiveDate
Updates the effective date of the last schedule filter using this source.- Parameters:
dt
- the effective date/time, the time will be discarded
-
setImportDate
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
- Specified by:
compareTo
in interfaceComparable<Object>
-
toString
-
hashCode
-
cacheKey
-
getComboAlias
Description copied from interface:ComboAlias
Returns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAlias
in interfaceComboAlias
- Returns:
- The alias for this entry
-
getComboName
Description copied from interface:ComboAlias
Returns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboName
in interfaceComboAlias
- Returns:
- The visible name for this entry
-