org.deltava.beans.schedule
Class Aircraft

java.lang.Object
  extended by org.deltava.beans.schedule.Aircraft
All Implemented Interfaces:
Comparable<Aircraft>, ViewEntry, Cacheable

public class Aircraft
extends Object
implements Comparable<Aircraft>, 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:
3.1
Author:
Luke

Field Summary
static int CENTER
           
static int CENTER2
           
static int CENTER3
           
static int EXT1
           
static int EXT2
           
static int LEFT_AUX
           
static int LEFT_MAIN
           
static int LEFT_TIP
           
static int OTHER
           
static int PRIMARY
           
static int RIGHT_AUX
           
static int RIGHT_MAIN
           
static int RIGHT_TIP
           
static int SECONDARY
           
static String[] TANK_NAMES
           
static String[] TANK_TYPES
           
 
Constructor Summary
Aircraft(String name)
          Initializes the bean.
 
Method Summary
 void addApp(AirlineInformation ai)
          Marks this aircraft type as used by a particular web application.
 void addIATA(String code)
          Links an IATA equipment code to this aircraft.
 Object cacheKey()
          Returns the aircrat name.
 void clearApps()
          Clears the web applications used with this aircraft type.
 int compareTo(Aircraft a2)
          Compares two aircraft by comparing their names.
 boolean equals(Object o)
           
 Collection<AirlineInformation> getApps()
          Returns all web applications using this aircraft type.
 int getBaseFuel()
          Returns the aircraft's base fuel load.
 int getCruiseSpeed()
          Returns the aircraft's cruise speed
 byte getEngines()
          Returns the number of engines on this aircraft.
 String getEngineType()
          Returns the aircraft's engine type.
 boolean getETOPS()
          Returns whether the aircraft is ETOPS-qualified.
 int getFuelFlow()
          Returns the aircraft's fuel flow.
 String getFullName()
          Returns the aircraft's full name.
 boolean getHistoric()
          Returns whether this aircraft is a Historic type.
 Collection<String> getIATA()
          Returns the aircraft's IATA equipment code(s).
 int getMaxLandingWeight()
          Returns the maximum landing weight of the Aircraft.
 int getMaxTakeoffWeight()
          Returns the maximum takeoff weight of the Aircraft.
 int getMaxWeight()
          Returns the maximum weight of the Aircraft.
 String getName()
          Returns the aircraft name.
 int getPct(int tankType)
          Returns the filling percentage for a particular tank type.
 int getRange()
          Returns the maximum range of the aircraft.
 String getRowClassName()
          Returns the CSS class name to use if displaying in a view table.
 Map<String,Collection<String>> getTankNames()
          Returns the fuel tank names, for display in a JSP.
 Map<String,Integer> getTankPercent()
          Returns the fuel tank fill percentages, for display in a JSP.
 int getTanks(int tankType)
          Returns the fuel tank codes for a particular tank type.
 int getTaxiFuel()
          Returns the aircraft's taxi fuel load.
 int hashCode()
          Returns the aircraft name hash code.
 boolean isUsed(String code)
          Returns whether a particular web application uses this aircraft type.
 void setBaseFuel(int fuelAmt)
          Updates the aircraft's base fuel load.
 void setCruiseSpeed(int speed)
          Updates the aircraft's cruise speed.
 void setEngines(byte engines)
          Updates the number of engines on this aircraft.
 void setEngineType(String engName)
          Updates the aircraft's engine type.
 void setETOPS(boolean isETOPS)
          Updates whether this aircraft is ETOPS-rated.
 void setFuelFlow(int flow)
          Updates the aircraft's cruise fuel flow.
 void setFullName(String name)
          Updates the aircraft's full name.
 void setHistoric(boolean isHistoric)
          Updates whether this aircraft is a Historic type.
 void setIATA(Collection<String> codes)
          Updates this aircraft's IATA codes.
 void setMaxLandingWeight(int weight)
          Updates the maximum landing weight of the Aircraft.
 void setMaxTakeoffWeight(int weight)
          Updates the maximum takeoff weight of the Aircraft.
 void setMaxWeight(int weight)
          Updates the maximum weight of the Aircraft.
 void setName(String name)
          Updates the aircraft name.
 void setPct(int tankType, int pct)
          Updates the tank usage percentage for a particular fuel tank type.
 void setRange(int range)
          Updates the maximum range of the aircraft.
 void setTanks(int tankType, Collection<String> tankNames)
          Updates the fuel tanks used in filling the aircraft.
 void setTanks(int tankType, int tankCodes)
          Updates the fuel tanks used in filling the aircraft.
 void setTaxiFuel(int fuelAmt)
          Updates the aircraft's taxi fuel load.
 String toString()
          Returns the aircraft name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CENTER

public static final int CENTER
See Also:
Constant Field Values

LEFT_MAIN

public static final int LEFT_MAIN
See Also:
Constant Field Values

LEFT_AUX

public static final int LEFT_AUX
See Also:
Constant Field Values

LEFT_TIP

public static final int LEFT_TIP
See Also:
Constant Field Values

RIGHT_MAIN

public static final int RIGHT_MAIN
See Also:
Constant Field Values

RIGHT_AUX

public static final int RIGHT_AUX
See Also:
Constant Field Values

RIGHT_TIP

public static final int RIGHT_TIP
See Also:
Constant Field Values

CENTER2

public static final int CENTER2
See Also:
Constant Field Values

CENTER3

public static final int CENTER3
See Also:
Constant Field Values

EXT1

public static final int EXT1
See Also:
Constant Field Values

EXT2

public static final int EXT2
See Also:
Constant Field Values

TANK_TYPES

public static final String[] TANK_TYPES

TANK_NAMES

public static final String[] TANK_NAMES

PRIMARY

public static final int PRIMARY
See Also:
Constant Field Values

SECONDARY

public static final int SECONDARY
See Also:
Constant Field Values

OTHER

public static final int OTHER
See Also:
Constant Field Values
Constructor Detail

Aircraft

public Aircraft(String name)
Initializes the bean.

Parameters:
name - the equipment name
Throws:
NullPointerException - if name is null
Method Detail

getName

public String getName()
Returns the aircraft name.

Returns:
the name
See Also:
setName(String)

getRange

public int getRange()
Returns the maximum range of the aircraft.

Returns:
the range in miles
See Also:
setRange(int)

getIATA

public Collection<String> getIATA()
Returns the aircraft's IATA equipment code(s).

Returns:
a sorted Collection of IATA codes
See Also:
addIATA(String), setIATA(Collection)

getHistoric

public boolean getHistoric()
Returns whether this aircraft is a Historic type.

Returns:
TRUE if this is a Historic type, otherwise FALSE
See Also:
setHistoric(boolean)

getETOPS

public boolean getETOPS()
Returns whether the aircraft is ETOPS-qualified.

Returns:
TRUE if this is ETOPS-rated, otherwise FALSE
See Also:
setETOPS(boolean)

getFullName

public String getFullName()
Returns the aircraft's full name.

Returns:
the full name
See Also:
setFullName(String)

getEngines

public byte getEngines()
Returns the number of engines on this aircraft.

Returns:
the number of engines
See Also:
setEngines(byte)

getEngineType

public String getEngineType()
Returns the aircraft's engine type.

Returns:
the engine type
See Also:
setEngineType(String)

getCruiseSpeed

public int getCruiseSpeed()
Returns the aircraft's cruise speed

Returns:
the cruise speed in knots
See Also:
setCruiseSpeed(int)

getBaseFuel

public int getBaseFuel()
Returns the aircraft's base fuel load.

Returns:
the fuel load in pounds
See Also:
setBaseFuel(int)

getTaxiFuel

public int getTaxiFuel()
Returns the aircraft's taxi fuel load.

Returns:
the fuel load in pounds
See Also:
setTaxiFuel(int)

getFuelFlow

public int getFuelFlow()
Returns the aircraft's fuel flow.

Returns:
the fuel flow in pounds per engine per hour
See Also:
setFuelFlow(int)

getApps

public Collection<AirlineInformation> getApps()
Returns all web applications using this aircraft type.

Returns:
a Collection of AirlineInformation beans
See Also:
isUsed(String), addApp(AirlineInformation), AirlineInformation

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:
getApps(), addApp(AirlineInformation)

getTanks

public int getTanks(int tankType)
Returns the fuel tank codes for a particular tank type.

Parameters:
tankType - the fuel tank type
Returns:
the tank codes as a bitmap
Throws:
IllegalArgumentException - if tankType is invalid
See Also:
getTankNames(), setTanks(int, int)

getPct

public int getPct(int tankType)
Returns the filling percentage for a particular tank type.

Parameters:
tankType - the fuel tank type
Returns:
the percentage each tank should be filled
Throws:
IllegalArgumentException - if tankType is invalid
See Also:
setPct(int, int)

getTankNames

public Map<String,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(), TANK_TYPES, TANK_NAMES

getTankPercent

public Map<String,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:
getTankNames(), TANK_TYPES, TANK_NAMES

getMaxWeight

public int getMaxWeight()
Returns the maximum weight of the Aircraft.

Returns:
the weight in pounds
See Also:
setMaxWeight(int)

getMaxTakeoffWeight

public int getMaxTakeoffWeight()
Returns the maximum takeoff weight of the Aircraft.

Returns:
the weight in pounds
See Also:
setMaxTakeoffWeight(int)

getMaxLandingWeight

public int getMaxLandingWeight()
Returns the maximum landing weight of the Aircraft.

Returns:
the weight in pounds
See Also:
setMaxLandingWeight(int)

addApp

public void addApp(AirlineInformation ai)
Marks this aircraft type as used by a particular web application.

Parameters:
ai - the AirlineInformation bean
See Also:
isUsed(String), getApps(), AirlineInformation

clearApps

public void clearApps()
Clears the web applications used with this aircraft type.


setName

public void setName(String name)
Updates the aircraft name.

Parameters:
name - the name
Throws:
NullPointerException - if name is null
See Also:
getName()

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:
getFullName()

setRange

public void setRange(int range)
Updates the maximum range of the aircraft.

Parameters:
range - the range in miles
See Also:
getRange()

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:
getHistoric()

setETOPS

public void setETOPS(boolean isETOPS)
Updates whether this aircraft is ETOPS-rated.

Parameters:
isETOPS - TRUE if ETOPS-rated, otherwise FALSE

setMaxWeight

public void setMaxWeight(int weight)
Updates the maximum weight of the Aircraft.

Parameters:
weight - the weight in pounds
See Also:
getMaxWeight()

setMaxTakeoffWeight

public void setMaxTakeoffWeight(int weight)
Updates the maximum takeoff weight of the Aircraft.

Parameters:
weight - the weight in pounds
See Also:
getMaxTakeoffWeight()

setMaxLandingWeight

public void setMaxLandingWeight(int weight)
Updates the maximum landing weight of the Aircraft.

Parameters:
weight - the weight in pounds
See Also:
setMaxLandingWeight(int)

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:
getIATA(), setIATA(Collection)

setIATA

public void setIATA(Collection<String> codes)
Updates this aircraft's IATA codes.

Parameters:
codes - a Collection of codes
See Also:
addIATA(String), getIATA()

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:
getEngines()

setEngineType

public void setEngineType(String engName)
Updates the aircraft's engine type.

Parameters:
engName - the engine type
See Also:
getEngineType()

setCruiseSpeed

public void setCruiseSpeed(int speed)
Updates the aircraft's cruise speed.

Parameters:
speed - the speed in knots
See Also:
getCruiseSpeed()

setBaseFuel

public void setBaseFuel(int fuelAmt)
Updates the aircraft's base fuel load.

Parameters:
fuelAmt - the amount of fuel in pounds
See Also:
getBaseFuel()

setTaxiFuel

public void setTaxiFuel(int fuelAmt)
Updates the aircraft's taxi fuel load.

Parameters:
fuelAmt - the amount of fuel in pounds
See Also:
getTaxiFuel()

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:
getFuelFlow()

setPct

public void setPct(int tankType,
                   int pct)
Updates the tank usage percentage for a particular fuel tank type.

Parameters:
tankType - the tank type
pct - the percentage required to be filled before filling the next tank type
Throws:
IllegalArgumentException - if tankType is invalid
See Also:
getPct(int)

setTanks

public void setTanks(int tankType,
                     int tankCodes)
Updates the fuel tanks used in filling the aircraft.

Parameters:
tankType - the tank type
tankCodes - the codes for the fuel tanks used in this order
Throws:
IllegalArgumentException - if tankType is invalid
See Also:
setTanks(int, Collection), getTanks(int), getTankNames()

setTanks

public void setTanks(int tankType,
                     Collection<String> tankNames)
Updates the fuel tanks used in filling the aircraft.

Parameters:
tankType - the tank type
tankNames - a Collection of tank names
Throws:
IllegalArgumentException - if tankType is invalid
See Also:
setTanks(int, int), getTanks(int), getTankNames()

compareTo

public int compareTo(Aircraft a2)
Compares two aircraft by comparing their names.

Specified by:
compareTo in interface Comparable<Aircraft>

equals

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

toString

public String toString()
Returns the aircraft name.

Overrides:
toString in class Object

hashCode

public int hashCode()
Returns the aircraft name hash code.

Overrides:
hashCode in class Object

cacheKey

public Object cacheKey()
Returns the aircrat name.

Specified by:
cacheKey in interface Cacheable
Returns:
the cache key for the object

getRowClassName

public String getRowClassName()
Returns the CSS class name to use if displaying in a view table.

Specified by:
getRowClassName in interface ViewEntry
Returns:
the CSS class name


Copyright © 2004-2009 Global Virtual Airlines Group. All Rights Reserved.