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.4
- Author:
- Luke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(DraftFlightReport dfr) Adds a Draft Flight Report to calculate timeliness.Returns the ScheduleEntry used to calculate timeliness.intReturns the departure time tolerance limit.booleanReturns if the helper has any flights to check against.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. This will be added at the start of the list of flights to take precedence over shceudle entries.- Parameters:
dfr- a DraftFlightReport
-
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
-