Class Flight
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.Flight
- All Implemented Interfaces:
Serializable,Comparable<Object>,FlightNumber,IDBean,RoutePair,Cacheable
- Direct Known Subclasses:
AssignmentLeg,FlightReport,ScheduleEntry,ScheduleSearchCriteria
A class to store Flight information.
- Since:
- 1.0
- Version:
- 11.3
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.deltava.beans.schedule.RoutePair
RoutePair.RoutePairImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanReturns the Airline.Returns the arrival Airport.Returns the departure Airport.Returns the flight code as a callsign, using the Airline ICAO code.intReturns the distance between the Airports.abstract DurationA method to return the exact length of the flight.Returns the Equipment type for this flightReturns a text representation of the Flight in the format "CODE### Leg #".intReturns the Flight Number.intgetLeg()Returns the Flight Leg.Returns an abbreviated version of the Flight code with a dash instead of text.abstract intA method to return the length of the flight in hours multiplied by 10.Returns the Flight code without the leg.inthashCode()voidSet the Airline for this flight.voidSets the Arrival Airport object for this flight.voidSets the Departure Airport object for this flight.voidsetEquipmentType(String eqType) Sets the equipment type for this flight.voidsetFlightNumber(int fNumber) Set the Flight Number for this flightvoidsetLeg(int leg) Sets the Flight leg for this flighttoString()Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, getHexID, getID, setID, validateID, validateIDMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.deltava.beans.schedule.RoutePair
createKey, getAirports, getFlightType, includes, isPopulated, matches, midPoint
-
Constructor Details
-
Flight
Creates the bean.- Parameters:
a- the AirlinefNumber- the flight numberleg- the leg
-
-
Method Details
-
getLength
public abstract int getLength()A method to return the length of the flight in hours multiplied by 10.- Returns:
- the length of the flight
-
getDuration
A method to return the exact length of the flight.- Returns:
- a Duration
-
getDistance
public int getDistance()Description copied from interface:RoutePairReturns the distance between the Airports.- Specified by:
getDistancein interfaceRoutePair- Returns:
- the distance in miles, or -1 if not populated
-
getAirline
Description copied from interface:FlightNumberReturns the Airline.- Specified by:
getAirlinein interfaceFlightNumber- Returns:
- the Airline
-
getFlightCode
Returns a text representation of the Flight in the format "CODE### Leg #".- Returns:
- the flight code
- See Also:
-
getShortCode
Returns the Flight code without the leg.- Returns:
- the flight code
- See Also:
-
getCallsign
Returns the flight code as a callsign, using the Airline ICAO code.- Returns:
- the callsign
- See Also:
-
getLegCode
Returns an abbreviated version of the Flight code with a dash instead of text.- Returns:
- the flight code
- See Also:
-
getFlightNumber
public int getFlightNumber()Description copied from interface:FlightNumberReturns the Flight Number.- Specified by:
getFlightNumberin interfaceFlightNumber- Returns:
- the flight number
-
getLeg
public int getLeg()Description copied from interface:FlightNumberReturns the Flight Leg.- Specified by:
getLegin interfaceFlightNumber- Returns:
- the leg
-
getEquipmentType
Returns the Equipment type for this flight- Returns:
- the equipment code
- See Also:
-
getAirportA
Description copied from interface:RoutePairReturns the arrival Airport.- Specified by:
getAirportAin interfaceRoutePair- Returns:
- the arrival Airport
-
getAirportD
Description copied from interface:RoutePairReturns the departure Airport.- Specified by:
getAirportDin interfaceRoutePair- Returns:
- the departure Airport
-
setAirline
Set the Airline for this flight.- Parameters:
a- the Airline- See Also:
-
setFlightNumber
public void setFlightNumber(int fNumber) Set the Flight Number for this flight- Parameters:
fNumber- the Flight Number- See Also:
-
setLeg
public void setLeg(int leg) Sets the Flight leg for this flight- Parameters:
leg- the Flight leg- Throws:
IllegalArgumentException- if the flight leg is negative or > 8- See Also:
-
setEquipmentType
Sets the equipment type for this flight.- Parameters:
eqType- the aircraft type
-
setAirportA
Sets the Arrival Airport object for this flight.- Parameters:
a- the Arrival Airport object
-
setAirportD
Sets the Departure Airport object for this flight.- Parameters:
a- the Departure Airport object
-
compareTo
- Specified by:
compareToin interfaceComparable<Object>- Overrides:
compareToin classDatabaseBean
-
equals
- Overrides:
equalsin classDatabaseBean
-
toString
-
hashCode
public int hashCode()- Overrides:
hashCodein classDatabaseBean
-