Class Aircraft

java.lang.Object
org.deltava.beans.schedule.Aircraft
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Aircraft>, Auditable, ViewEntry, Cacheable

public class Aircraft extends Object implements Comparable<Aircraft>, Auditable, Cacheable, ViewEntry
A bean to store Aircraft type information and ACARS fuel profiles. Fuel is loaded in ACARS in the order of primary, secondary and other tanks, and each Microsoft Flight Simulator fuel tank can be assigned to one of these three tank types.
Since:
1.0
Version:
11.0
Author:
Luke
See Also:
  • Constructor Details

    • Aircraft

      public Aircraft(String name)
      Initializes the bean.
      Parameters:
      name - the equipment name
      Throws:
      NullPointerException - if name is null
  • Method Details

    • getName

      public String getName()
      Returns the aircraft name.
      Returns:
      the name
      See Also:
    • getFamily

      public String getFamily()
      Returns the aircraft family name.
      Returns:
      the family name
      See Also:
    • getICAO

      public String getICAO()
      Returns the aircraft's ICAO equipmnet code.
      Returns:
      the ICAO equipment code
      See Also:
    • getIATA

      public Collection<String> getIATA()
      Returns the aircraft's IATA equipment code(s).
      Returns:
      a sorted Collection of IATA codes
      See Also:
    • getHistoric

      public boolean getHistoric()
      Returns whether this aircraft is a Historic type.
      Returns:
      TRUE if this is a Historic type, otherwise FALSE
      See Also:
    • getAcademyOnly

      public boolean getAcademyOnly()
      Returns whether this aircraft is only used in the Flight Academy.
      Returns:
      TRUE if only used in the Flight Academy, otherwise FALSE
      See Also:
    • getFullName

      public String getFullName()
      Returns the aircraft's full name.
      Returns:
      the full name
      See Also:
    • getEngines

      public byte getEngines()
      Returns the number of engines on this aircraft.
      Returns:
      the number of engines
      See Also:
    • getEngineType

      public String getEngineType()
      Returns the aircraft's engine type.
      Returns:
      the engine type
      See Also:
    • getCruiseSpeed

      public int getCruiseSpeed()
      Returns the aircraft's cruise speed
      Returns:
      the cruise speed in knots
      See Also:
    • getBaseFuel

      public int getBaseFuel()
      Returns the aircraft's base fuel load.
      Returns:
      the fuel load in pounds
      See Also:
    • getTaxiFuel

      public int getTaxiFuel()
      Returns the aircraft's taxi fuel load.
      Returns:
      the fuel load in pounds
      See Also:
    • getFuelFlow

      public int getFuelFlow()
      Returns the aircraft's fuel flow.
      Returns:
      the fuel flow in pounds per engine per hour
      See Also:
    • getApps

      public Collection<String> getApps()
      Returns all web applications using this aircraft type.
      Returns:
      a Collection of AirlineInformation beans
      See Also:
    • getOptions

      public AircraftPolicyOptions getOptions(String appCode)
      Returns policy options for this Aircraft for a specific virtual airline.
      Parameters:
      appCode - the virtual airline code
      Returns:
      an AircraftPolicyOptions bean, or null if airline not found
    • isUsed

      public boolean isUsed(String code)
      Returns whether a particular web application uses this aircraft type.
      Parameters:
      code - the web application airline code
      Returns:
      TRUE if the aircraft is used by this web application, otherwise FALSE
      See Also:
    • getTanks

      public int getTanks(TankType tt)
      Returns the fuel tank codes for a particular tank type.
      Parameters:
      tt - the TankType
      Returns:
      the tank codes as a bitmap
      Throws:
      IllegalArgumentException - if tankType is invalid
      See Also:
    • getPct

      public int getPct(TankType tt)
      Returns the filling percentage for a particular tank type.
      Parameters:
      tt - the TankType
      Returns:
      the percentage each tank should be filled
      Throws:
      IllegalArgumentException - if tankType is invalid
      See Also:
    • getTankNames

      public Map<TankType, Collection<String>> getTankNames()
      Returns the fuel tank names, for display in a JSP.
      Returns:
      a Map of Collections of tank names, keyed by tank type
      See Also:
    • getTankPercent

      public Map<TankType,Integer> getTankPercent()
      Returns the fuel tank fill percentages, for display in a JSP.
      Returns:
      a Map of tank percentages, keyed by tank type
      See Also:
    • getMaxWeight

      public int getMaxWeight()
      Returns the maximum weight of the Aircraft.
      Returns:
      the weight in pounds
      See Also:
    • getMaxZeroFuelWeight

      public int getMaxZeroFuelWeight()
      Returns the maximum zero fuel weight of the Aircraft.
      Returns:
      the weight in pounds
      See Also:
    • getMaxTakeoffWeight

      public int getMaxTakeoffWeight()
      Returns the maximum takeoff weight of the Aircraft.
      Returns:
      the weight in pounds
      See Also:
    • getMaxLandingWeight

      public int getMaxLandingWeight()
      Returns the maximum landing weight of the Aircraft.
      Returns:
      the weight in pounds
      See Also:
    • addApp

      public void addApp(AircraftPolicyOptions opts)
      Marks this aircraft type as used by a particular web application.
      Parameters:
      opts - the AirlinePolicyOptions bean
      See Also:
    • removeApp

      public void removeApp(String appCode)
      Removes a web application from this aircraft type.
      Parameters:
      appCode - the virtual airline code
    • setName

      public void setName(String name)
      Updates the aircraft name.
      Parameters:
      name - the name
      Throws:
      NullPointerException - if name is null
      See Also:
    • setFullName

      public void setFullName(String name)
      Updates the aircraft's full name.
      Parameters:
      name - the full name
      Throws:
      NullPointerException - if name is null
      See Also:
    • setFamily

      public void setFamily(String family)
      Updates the aircraft family code, using for multi-player fallback rendering.
      Parameters:
      family - the family code
      Throws:
      NullPointerException - if family is null
      See Also:
    • setHistoric

      public void setHistoric(boolean isHistoric)
      Updates whether this aircraft is a Historic type.
      Parameters:
      isHistoric - TRUE if a Historic type, otherwise FALSE
      See Also:
    • setAcadedmyOnly

      public void setAcadedmyOnly(boolean isAcademy)
      Updates whether this aircraft is only used in the Flight Academy.
      Parameters:
      isAcademy - TRUE if Flight Academy only, otherwise FALSE
      See Also:
    • setMaxWeight

      public void setMaxWeight(int weight)
      Updates the maximum weight of the Aircraft.
      Parameters:
      weight - the weight in pounds
      See Also:
    • setMaxZeroFuelWeight

      public void setMaxZeroFuelWeight(int weight)
      Updates the maximum zero fuel weight of the Aircraft.
      Parameters:
      weight - the weight in pounds
      See Also:
    • setMaxTakeoffWeight

      public void setMaxTakeoffWeight(int weight)
      Updates the maximum takeoff weight of the Aircraft.
      Parameters:
      weight - the weight in pounds
      See Also:
    • setMaxLandingWeight

      public void setMaxLandingWeight(int weight)
      Updates the maximum landing weight of the Aircraft.
      Parameters:
      weight - the weight in pounds
      See Also:
    • setICAO

      public void setICAO(String code)
      Updates the aircraft's ICAO code.
      Parameters:
      code - the ICAO code
    • addIATA

      public void addIATA(String code)
      Links an IATA equipment code to this aircraft.
      Parameters:
      code - the equipment code
      Throws:
      NullPointerException - if code is null
      See Also:
    • setIATA

      public void setIATA(Collection<String> codes)
      Updates this aircraft's IATA codes.
      Parameters:
      codes - a Collection of codes
      See Also:
    • setEngines

      public void setEngines(byte engines)
      Updates the number of engines on this aircraft.
      Parameters:
      engines - the number of engnes
      Throws:
      IllegalArgumentException - if engines is zero, negative or > 8
      See Also:
    • setEngineType

      public void setEngineType(String engName)
      Updates the aircraft's engine type.
      Parameters:
      engName - the engine type
      See Also:
    • setCruiseSpeed

      public void setCruiseSpeed(int speed)
      Updates the aircraft's cruise speed.
      Parameters:
      speed - the speed in knots
      See Also:
    • setBaseFuel

      public void setBaseFuel(int fuelAmt)
      Updates the aircraft's base fuel load.
      Parameters:
      fuelAmt - the amount of fuel in pounds
      See Also:
    • setTaxiFuel

      public void setTaxiFuel(int fuelAmt)
      Updates the aircraft's taxi fuel load.
      Parameters:
      fuelAmt - the amount of fuel in pounds
      See Also:
    • setFuelFlow

      public void setFuelFlow(int flow)
      Updates the aircraft's cruise fuel flow.
      Parameters:
      flow - the fuel flow in pounds per engine per hour
      See Also:
    • setPct

      public void setPct(TankType tt, int pct)
      Updates the tank usage percentage for a particular fuel tank type.
      Parameters:
      tt - the TankType
      pct - the percentage required to be filled before filling the next tank type
      Throws:
      IllegalArgumentException - if tankType is invalid
      See Also:
    • setTanks

      public void setTanks(TankType tt, int tankCodes)
      Updates the fuel tanks used in filling the aircraft.
      Parameters:
      tt - the TankType
      tankCodes - the codes for the fuel tanks used in this order
      Throws:
      IllegalArgumentException - if tankType is invalid
      See Also:
    • setTanks

      public void setTanks(TankType tt, Collection<String> tankNames)
      Updates the fuel tanks used in filling the aircraft.
      Parameters:
      tt - the TankType
      tankNames - a Collection of tank names
      Throws:
      IllegalArgumentException - if tankType is invalid
      See Also:
    • compareTo

      public int compareTo(Aircraft a2)
      Specified by:
      compareTo in interface Comparable<Aircraft>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • cacheKey

      public Object cacheKey()
      Description copied from interface: Cacheable
      Returns the cache key for this object. Caches call this method when adding the object.
      Specified by:
      cacheKey in interface Cacheable
      Returns:
      the cache key for the object
    • getAuditID

      public String getAuditID()
      Description copied from interface: Auditable
      Returns the object ID for this auditable object.
      Specified by:
      getAuditID in interface Auditable
      Returns:
      the ID
    • getRowClassName

      public String getRowClassName()
      Description copied from interface: ViewEntry
      Returns the CSS class for this object if rendered in a view table.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name, or NULL if none