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 TypeMethodDescriptionint
boolean
Returns the Airline.Returns the arrival Airport.Returns the departure Airport.Returns the flight code as a callsign, using the Airline ICAO code.int
Returns the distance between the Airports.abstract Duration
A 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 #".int
Returns the Flight Number.int
getLeg()
Returns the Flight Leg.Returns an abbreviated version of the Flight code with a dash instead of text.abstract int
A method to return the length of the flight in hours multiplied by 10.Returns the Flight code without the leg.int
hashCode()
void
Set the Airline for this flight.void
Sets the Arrival Airport object for this flight.void
Sets the Departure Airport object for this flight.void
setEquipmentType
(String eqType) Sets the equipment type for this flight.void
setFlightNumber
(int fNumber) Set the Flight Number for this flightvoid
setLeg
(int leg) Sets the Flight leg for this flighttoString()
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, getHexID, getID, setID, validateID, validateID
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.deltava.beans.schedule.RoutePair
createKey, getAirports, getFlightType, includes, isPopulated, matches
-
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:RoutePair
Returns the distance between the Airports.- Specified by:
getDistance
in interfaceRoutePair
- Returns:
- the distance in miles
-
getAirline
Description copied from interface:FlightNumber
Returns the Airline.- Specified by:
getAirline
in 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:FlightNumber
Returns the Flight Number.- Specified by:
getFlightNumber
in interfaceFlightNumber
- Returns:
- the flight number
-
getLeg
public int getLeg()Description copied from interface:FlightNumber
Returns the Flight Leg.- Specified by:
getLeg
in interfaceFlightNumber
- Returns:
- the leg
-
getEquipmentType
Returns the Equipment type for this flight- Returns:
- the equipment code
- See Also:
-
getAirportA
Description copied from interface:RoutePair
Returns the arrival Airport.- Specified by:
getAirportA
in interfaceRoutePair
- Returns:
- the arrival Airport
-
getAirportD
Description copied from interface:RoutePair
Returns the departure Airport.- Specified by:
getAirportD
in 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:
compareTo
in interfaceComparable<Object>
- Overrides:
compareTo
in classDatabaseBean
-
equals
- Overrides:
equals
in classDatabaseBean
-
toString
-
hashCode
public int hashCode()- Overrides:
hashCode
in classDatabaseBean
-