Class OnTimeHelper
java.lang.Object
org.deltava.beans.flight.OnTimeHelper
A utility class to calculate on-time statistics for a flight.
- Since:
- 8.4
- Version:
- 12.0
- Author:
- Luke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(DraftFlightReport dfr) Adds a Draft Flight Report to calculate timeliness.Returns the ScheduleEntry used to calculate timeliness.int
Returns the departure time tolerance limit.boolean
Returns if the helper has any flights to check against.void
setDepartureTolerance
(int minutes) Sets the tolerance for finding a possible departure flight.validate
(FlightTimes fr) Determines whether a flight was on time.Determines whether a flight is departing on time.
-
Constructor Details
-
OnTimeHelper
Initializes the helper.- Parameters:
entries
- a Collection of ScheduleEntry beans
-
-
Method Details
-
getScheduleEntry
Returns the ScheduleEntry used to calculate timeliness.- Returns:
- a ScheduleEntry, or null if none meeting tolerances
-
getTolerance
public int getTolerance()Returns the departure time tolerance limit.- Returns:
- the limit in minutes
-
hasFlights
public boolean hasFlights()Returns if the helper has any flights to check against.- Returns:
- TRUE if flights or schedule entries have been loaded, otherwise FALSE
-
add
Adds a Draft Flight Report to calculate timeliness. This is used for situations where a Flight Assignment was generated on a different day and the schedule no longer contains the same flights.- Parameters:
dfr
- a DraftFlightReport
-
setDepartureTolerance
public void setDepartureTolerance(int minutes) Sets the tolerance for finding a possible departure flight.- Parameters:
minutes
- the tolerance in minutes
-
validate
Determines whether a flight was on time.- Parameters:
fr
- a FlightTimes object- Returns:
- an OnTime enumeration
-
validateDeparture
Determines whether a flight is departing on time.- Parameters:
fr
- a FlightTimesl object- Returns:
- an OnTime enumeration
-