Class FlightReport
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.Flight
org.deltava.beans.flight.FlightReport
- All Implemented Interfaces:
Serializable, Comparable<Object>, AuthoredBean, CalendarEntry, FlightData, FlightNumber, IDBean, RoutePair, ViewEntry, Cacheable
- Direct Known Subclasses:
DraftFlightReport, FDRFlightReport
public class FlightReport
extends Flight
implements FlightData, AuthoredBean, CalendarEntry, ViewEntry
A class for dealing with PIREP data.
- Since:
- 1.0
- Version:
- 12.2
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface RoutePair
RoutePair.RoutePairImpl -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Flight Report from an existing Flight entry (like an Assignment or ScheduleEntry).FlightReport(Airline a, int flightNumber, int leg) Creates a new Flight Report object with a given flight. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStatusUpdate(int authorID, HistoryType type, String msg) Creates a new status update and adds it to the Flight Report.voidAdds a status update to this Flight Report.intintReturns the attributes for this Flight Report.intReturns the Author of this bean.Returns if this flight counts towards promotion in a particular equipment type program.Returns the disposition comments for this Flight Report.intgetDatabaseID(DatabaseID idType) Sets the database row ID of a relatied database row.getDate()Returns the date of the flight.The date/time this Flight Report was disposed on.A method to return the exact length of the flight.getFDR()Returns the Flight Data recorder used for this flight.intReturns the length of the fllight in hours multiplied by ten.doubleReturns the load factor for this flight.Returns the OnlineNetwork the flight is operated on.intReturns the number of passengers carried on this flight.getRank()Returns the Pilot's rank at the time of the Flight.Returns the remarks for this Flight Report.getRoute()Returns the filed Flight Route.Returns the CSS class for this object if rendered in a view table.Returns the Simulator used for this flight.Returns the status of this Flight Report.Returns the flight status history.The date/time this Flight Report was submitted for approval.booleanReturns the presence of a particular flight Attribute.booleanhasDatabaseID(DatabaseID idType) Returns whether this Flight has a related database row ID.voidsetAttribute(Attribute a, boolean isSet) Set/Clear a particular Attribute for this Flight Report.voidsetAttributes(int attrs) Sets the attributes for this Flight Report.voidsetAuthorID(int id) Updates the author of this bean.voidsetCaptEQType(String eqType) Sets if this Flight counts towards promotion in a particular equipment program.voidsetCaptEQType(Collection<String> eqTypes) Sets if this Flight counts towards promotion in a particular equipment program.voidsetComments(String comments) Sets the disposition comments for this Flight Report.voidsetDatabaseID(DatabaseID idType, int id) Sets the database row ID of a relatied database row.voidUpdates the date that this Flight was flown on.voidsetDisposedOn(Instant dd) Updates the date/time this Flight Report was approved or rejected on.voidsetID(int id) Updates the database ID, and the database ID of any associated status updates.final voidsetLeg(int leg) Sets the Flight Leg.voidsetLength(int length) Sets the length of this Flight, in hours multiplied by 10.voidsetLoadFactor(double lf) Updates the load factor for this flight.voidsetNetwork(OnlineNetwork network) Updates the Online Network used on this Flight.voidsetPassengers(int ps) Updates the number of passengers carried on this flight.voidUpdates the rank of the Pilot filing this report.voidsetRemarks(String remarks) Sets the remarks for this Flight Report.voidUpdates the filed Flight Route.voidsetSimulator(Simulator sim) Updates the Simulator used for this flight.voidsetStatus(FlightStatus status) Sets the status of this Flight Report.voidUpdates the date/time this Flight Report was submitted on.Methods inherited from class Flight
equals, getAirline, getAirportA, getAirportD, getCallsign, getDistance, getEquipmentType, getFlightCode, getFlightNumber, getLeg, getLegCode, getShortCode, hashCode, setAirline, setAirportA, setAirportD, setEquipmentType, setFlightNumber, toStringMethods inherited from class DatabaseBean
cacheKey, getHexID, getID, validateID, validateIDMethods inherited from interface FlightData
getEquipmentTypeMethods inherited from interface FlightNumber
getAirline, getFlightNumber, getLegMethods inherited from interface RoutePair
createKey, getAirportA, getAirportD, getAirports, getDistance, getFlightType, includes, isPopulated, matches, midPoint
-
Field Details
-
ATTR_WARN_MASK
Deprecated.Attribute mask for all warnings.- See Also:
-
-
Constructor Details
-
FlightReport
Creates a new Flight Report object with a given flight.- Parameters:
a- the AirlineflightNumber- the Flight Numberleg- the Leg Number- Throws:
NullPointerException- if the Airline Code is nullIllegalArgumentException- if the Flight Report is zero or negativeIllegalArgumentException- if the Leg is less than 1 or greater than 5- See Also:
-
FlightReport
Creates a new Flight Report from an existing Flight entry (like an Assignment or ScheduleEntry).- Parameters:
f- the existing Flight
-
-
Method Details
-
getRank
Returns the Pilot's rank at the time of the Flight.- Returns:
- the Pilot's rank
- See Also:
-
getLength
-
getDuration
Description copied from class:FlightA method to return the exact length of the flight.- Specified by:
getDurationin classFlight- Returns:
- a Duration
-
getFDR
Description copied from interface:FlightDataReturns the Flight Data recorder used for this flight.- Specified by:
getFDRin interfaceFlightData- Returns:
- a Recorder enum or null if none/unknown
-
getRemarks
Returns the remarks for this Flight Report.- Returns:
- the remarks
- See Also:
-
getRoute
-
getComments
Returns the disposition comments for this Flight Report.- Returns:
- the disposition comments
- See Also:
-
getCaptEQType
Returns if this flight counts towards promotion in a particular equipment type program.- Returns:
- the equipment type program name(s), or an empty Collection if this flight does not count
-
getStatusUpdates
Returns the flight status history.- Returns:
- a Collection of FlightHistoryEntry beans
-
getDate
Description copied from interface:FlightDataReturns the date of the flight.- Specified by:
getDatein interfaceCalendarEntry- Specified by:
getDatein interfaceFlightData- Returns:
- the date/time
-
getSubmittedOn
The date/time this Flight Report was submitted for approval.- Returns:
- the submission date/time of this PIREP, null if never submitted.
- See Also:
-
getDisposedOn
The date/time this Flight Report was disposed on. (approved or rejected)- Returns:
- the approval/rejected date/time of this PIREP, null if not disposed of
- See Also:
-
getDatabaseID
Sets the database row ID of a relatied database row. This row may be present in the PILOTS, ASSIGNMENTS, ACARS_PIREPS or EVENTS table. This is typically used by a DAO- Parameters:
idType- the datbase row ID type- Returns:
- the database row ID, or 0 if not found
- Throws:
NullPointerException- if idType is null- See Also:
-
hasDatabaseID
Returns whether this Flight has a related database row ID.- Parameters:
idType- the database row ID type- Returns:
- TRUE if the database row ID is not zero, otherwise FALSE
- Throws:
NullPointerException- if idType is null- See Also:
-
getAuthorID
public int getAuthorID()Description copied from interface:AuthoredBeanReturns the Author of this bean.- Specified by:
getAuthorIDin interfaceAuthoredBean- Returns:
- the author's database ID
- See Also:
-
getSimulator
Description copied from interface:FlightDataReturns the Simulator used for this flight.- Specified by:
getSimulatorin interfaceFlightData- Returns:
- a Simulator
-
getAttributes
public int getAttributes()Returns the attributes for this Flight Report.- Returns:
- a bit-mask containing this Flight Report's attributes
- See Also:
-
getStatus
Returns the status of this Flight Report.- Returns:
- the status of this PIREP
- See Also:
-
getNetwork
Description copied from interface:FlightDataReturns the OnlineNetwork the flight is operated on.- Specified by:
getNetworkin interfaceFlightData- Returns:
- an OnlineNetwork or null if offline
-
getPassengers
public int getPassengers()Returns the number of passengers carried on this flight.- Returns:
- the number of passengers
- See Also:
-
getLoadFactor
public double getLoadFactor()Returns the load factor for this flight.- Returns:
- the load factor from 0 to 1
- See Also:
-
hasAttribute
Returns the presence of a particular flight Attribute.- Parameters:
a- the Attribute- Returns:
- TRUE if the Attribute is present
- See Also:
-
setNetwork
Updates the Online Network used on this Flight.- Parameters:
network- an OnlineNetwork enum- See Also:
-
setRank
Updates the rank of the Pilot filing this report.- Parameters:
rank- the rank- See Also:
-
setRemarks
Sets the remarks for this Flight Report.- Parameters:
remarks- the remarks- See Also:
-
setRoute
Updates the filed Flight Route.- Parameters:
rt- the route- See Also:
-
setComments
Sets the disposition comments for this Flight Report.- Parameters:
comments- the disposition comments- See Also:
-
setCaptEQType
Sets if this Flight counts towards promotion in a particular equipment program.- Parameters:
eqTypes- a Collection of equipment program names- See Also:
-
setCaptEQType
Sets if this Flight counts towards promotion in a particular equipment program.- Parameters:
eqType- an equipment program names- See Also:
-
addStatusUpdate
Adds a status update to this Flight Report.- Parameters:
upd- a FlightHistoryEntry
-
addStatusUpdate
Creates a new status update and adds it to the Flight Report.- Parameters:
authorID- the Author's database IDtype- the HistoryTypemsg- the status message
-
setID
public void setID(int id) Updates the database ID, and the database ID of any associated status updates.- Overrides:
setIDin classDatabaseBean- Parameters:
id- The primary key of the entry in the database that corresponds to this object.- See Also:
-
setLeg
-
setLength
public void setLength(int length) Sets the length of this Flight, in hours multiplied by 10.- Parameters:
length- the length of the flight, in hours multiplied by 10.
-
setStatus
Sets the status of this Flight Report.- Parameters:
status- the new FlightStatus for this Flight Report- See Also:
-
setAttributes
public void setAttributes(int attrs) Sets the attributes for this Flight Report.- Parameters:
attrs- the new attributes- See Also:
-
setAttribute
Set/Clear a particular Attribute for this Flight Report.- Parameters:
a- the Attribute to set or clearisSet- TRUE if attribute should be set, FALSE if attribute should be cleared- See Also:
-
setSimulator
Updates the Simulator used for this flight.- Parameters:
sim- the Simulator- See Also:
-
setDate
Updates the date that this Flight was flown on.- Parameters:
dt- when this flight was flown. The time component is undefined.- See Also:
-
setSubmittedOn
Updates the date/time this Flight Report was submitted on.- Parameters:
sd- this Flight Report was submitted for approval.- See Also:
-
setDisposedOn
Updates the date/time this Flight Report was approved or rejected on.- Parameters:
dd- when this Flight Report was approved or rejected.- See Also:
-
setPassengers
public void setPassengers(int ps) Updates the number of passengers carried on this flight.- Parameters:
ps- the number of passengers- See Also:
-
setLoadFactor
public void setLoadFactor(double lf) Updates the load factor for this flight.- Parameters:
lf- the load factor- See Also:
-
setDatabaseID
Sets the database row ID of a relatied database row. This row may be present in the PILOTS , ASSIGNMENTS , ACARS_PIREPS or EVENTS table. This is typically used by a DAO.- Parameters:
idType- the row ID typeid- the database row ID- Throws:
IllegalArgumentException- if the id is negative- See Also:
-
setAuthorID
public void setAuthorID(int id) Description copied from interface:AuthoredBeanUpdates the author of this bean.- Specified by:
setAuthorIDin interfaceAuthoredBean- Parameters:
id- the author's database ID.- See Also:
-
compareTo
-
getRowClassName
Description copied from interface:ViewEntryReturns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassNamein interfaceViewEntry- Returns:
- the CSS class name, or NULL if none
-