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:
- 10.3
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.deltava.beans.schedule.RoutePair
RoutePair.RoutePairImpl -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFlight Academy Training Flight.static final intFlight logged using ACARS.static final intFlight flown through prohibited airspace.static final intFlight flown as a Charter flight.static final intFlight flown as a Check Ride.static final intFlight flown using a Dispatcher-generated flight plan.static final intFlight diverted to alternate airport.static final intFlight flown with non-ETOPS-rated aircraft.static final intAttribute mask for ACARS/XACARS/simFDR flights.static final intFlight flown on FPI network.static final intFlight flown using Historic equipment.static final intFlight flown on IVAO network.static final intFlight flown without Equipment Type Rating.static final intAttribute mask for VATSIM/IVAO/FPI online flights.static final intFlight flown on PilotEdge network.static final intFlight flown on POSCON network.static final intFlight flown with excessive range for aircraft.static final intFlight flown with ACARS refueling detected.static final intFlight flown using unknown route pair.static final intFlight flown using an inappropriate runway surface.static final intFlight flown using a too-short takeoff or landing runway.static final intFlight planned using SimBrief.static final intFlight logged using simFDR.static final intFlight flown with unusually high or low logged hous.static final intFlight flown on VATSIM network.static final intAttribute mask for all warnings.static final intFlight flown with excessive weights for Aircraft.static final intFlight logged using XACARS.static final intMinimum ACARS client version for inclusion in statistics aggregation. -
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.booleanhasAttribute(int attrMask) Returns the presence of a particular flight attribute.booleanhasDatabaseID(DatabaseID idType) Returns whether this Flight has a related database row ID.voidsetAttribute(int attrMask, 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 org.deltava.beans.Flight
equals, getAirline, getAirportA, getAirportD, getCallsign, getDistance, getEquipmentType, getFlightCode, getFlightNumber, getLeg, getLegCode, getShortCode, hashCode, setAirline, setAirportA, setAirportD, setEquipmentType, setFlightNumber, toStringMethods inherited from class org.deltava.beans.DatabaseBean
cacheKey, getHexID, getID, validateID, validateIDMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.deltava.beans.flight.FlightData
getEquipmentTypeMethods inherited from interface org.deltava.beans.FlightNumber
getAirline, getFlightNumber, getLegMethods inherited from interface org.deltava.beans.schedule.RoutePair
createKey, getAirportA, getAirportD, getAirports, getDistance, getFlightType, includes, isPopulated, matches, midPoint
-
Field Details
-
ATTR_NOTRATED
public static final int ATTR_NOTRATEDFlight flown without Equipment Type Rating.- See Also:
-
ATTR_VATSIM
public static final int ATTR_VATSIMFlight flown on VATSIM network.- See Also:
-
ATTR_IVAO
public static final int ATTR_IVAOFlight flown on IVAO network.- See Also:
-
ATTR_FPI
public static final int ATTR_FPIFlight flown on FPI network.- See Also:
-
ATTR_ACARS
public static final int ATTR_ACARSFlight logged using ACARS.- See Also:
-
ATTR_ROUTEWARN
public static final int ATTR_ROUTEWARNFlight flown using unknown route pair.- See Also:
-
ATTR_TIMEWARN
public static final int ATTR_TIMEWARNFlight flown with unusually high or low logged hous.- See Also:
-
ATTR_CHECKRIDE
public static final int ATTR_CHECKRIDEFlight flown as a Check Ride.- See Also:
-
ATTR_CHARTER
public static final int ATTR_CHARTERFlight flown as a Charter flight.- See Also:
-
ATTR_HISTORIC
public static final int ATTR_HISTORICFlight flown using Historic equipment.- See Also:
-
ATTR_ACADEMY
public static final int ATTR_ACADEMYFlight Academy Training Flight.- See Also:
-
ATTR_RANGEWARN
public static final int ATTR_RANGEWARNFlight flown with excessive range for aircraft.- See Also:
-
ATTR_REFUELWARN
public static final int ATTR_REFUELWARNFlight flown with ACARS refueling detected.- See Also:
-
ATTR_ETOPSWARN
public static final int ATTR_ETOPSWARNFlight flown with non-ETOPS-rated aircraft.- See Also:
-
ATTR_DISPATCH
public static final int ATTR_DISPATCHFlight flown using a Dispatcher-generated flight plan.- See Also:
-
ATTR_WEIGHTWARN
public static final int ATTR_WEIGHTWARNFlight flown with excessive weights for Aircraft.- See Also:
-
ATTR_XACARS
public static final int ATTR_XACARSFlight logged using XACARS.- See Also:
-
ATTR_RWYWARN
public static final int ATTR_RWYWARNFlight flown using a too-short takeoff or landing runway.- See Also:
-
ATTR_RWYSFCWARN
public static final int ATTR_RWYSFCWARNFlight flown using an inappropriate runway surface.- See Also:
-
ATTR_SIMFDR
public static final int ATTR_SIMFDRFlight logged using simFDR.- See Also:
-
ATTR_PEDGE
public static final int ATTR_PEDGEFlight flown on PilotEdge network.- See Also:
-
ATTR_AIRSPACEWARN
public static final int ATTR_AIRSPACEWARNFlight flown through prohibited airspace.- See Also:
-
ATTR_DIVERT
public static final int ATTR_DIVERTFlight diverted to alternate airport.- See Also:
-
ATTR_POSCON
public static final int ATTR_POSCONFlight flown on POSCON network.- See Also:
-
ATTR_SIMBRIEF
public static final int ATTR_SIMBRIEFFlight planned using SimBrief.- See Also:
-
ATTR_WARN_MASK
public static final int ATTR_WARN_MASKAttribute mask for all warnings.- See Also:
-
ATTR_ONLINE_MASK
public static final int ATTR_ONLINE_MASKAttribute mask for VATSIM/IVAO/FPI online flights.- See Also:
-
ATTR_FDR_MASK
public static final int ATTR_FDR_MASKAttribute mask for ACARS/XACARS/simFDR flights.- See Also:
-
MIN_ACARS_CLIENT
public static final int MIN_ACARS_CLIENTMinimum ACARS client version for inclusion in statistics aggregation.- 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
public boolean hasAttribute(int attrMask) Returns the presence of a particular flight attribute.- Parameters:
attrMask- the attribute to check- 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
public void setAttribute(int attrMask, boolean isSet) Set/Clear a particular attribute for this Flight Report.- Parameters:
attrMask- the Attribute Mask to setisSet- 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
-