org.deltava.beans.schedule
Class Airport

java.lang.Object
  extended by org.deltava.beans.schedule.Airport
All Implemented Interfaces:
Serializable, Comparable<Airport>, ComboAlias, GeoLocation, GeospaceLocation, IconMapEntry, MapEntry, MarkerMapEntry, ICAOAirport, ViewEntry

public class Airport
extends Object
implements Serializable, Comparable<Airport>, ComboAlias, ViewEntry, ICAOAirport, MarkerMapEntry, IconMapEntry

A class for storing airport information.

Since:
1.0
Version:
3.1
Author:
Luke
See Also:
Serialized Form

Field Summary
static Airport ALL
          Special airport object for "All Airports"
static String[] CODETYPES
          Airport Code types.
static int IATA
           
static int ICAO
           
 
Fields inherited from interface org.deltava.beans.MapEntry
BLUE, BROWN, COLORS, GREEN, GREY, LINECOLORS, ORANGE, PURPLE, RED, WHITE, YELLOW
 
Fields inherited from interface org.deltava.beans.GeoLocation
DEGREE_MILES, LAT_DIRECTIONS, LATITUDE, LON_DIRECTIONS, LONGITUDE
 
Constructor Summary
Airport(String name)
          Create a new Airport object.
Airport(String iata, String icao, String name)
          Create a new Airport object.
 
Method Summary
 void addAirlineCode(String aCode)
          Adds an airline to the list of airlines associated with this Airport.
 int compareTo(Airport a2)
          Sort the airports by comparing their IATA codes.
 boolean equals(Object o2)
          Compares airports by ensuring that both the IATA and ICAO code are the same.
 boolean getADSE()
          Returns whether this Airport has ADSE-X radar.
 Collection<String> getAirlineCodes()
          Returns a list codes for the airlines associated with this Airport.
 int getAltitude()
          Return this airport's altitude.
 String getComboAlias()
          Returns the alias to use in the HTML <OPTION> element.
 String getComboName()
          Returns the visible name to use in the HTML <OPTION> element.
 String getIATA()
          Return this airprort's IATA Code.
 String getICAO()
          Return this airport's ICAO Code.
 int getIconCode()
          Returns the Google Earth icon code.
 String getIconColor()
          Return the default Google Maps icon color.
 String getInfoBox()
          Returns the default Google Maps infobox text.
 double getLatitude()
          Return this airport's latitude.
 double getLongitude()
          Return this airport's longitude.
 double getMagVar()
          Returns this airport's magnetic variation.
 String getName()
          Return this airport's name.
 int getPaletteCode()
          Returns the Google Earth palette code.
 GeoPosition getPosition()
          Returns this airport's latitude and longitude.
 String getRegion()
          Returns the ICAO region containing this Airport.
 String getRowClassName()
          Returns the CSS class for this object if rendered in a view table.
 TZInfo getTZ()
          Returns this airport's time zone.
 boolean hasAirlineCode(String code)
          Determines if a particular airline services this Airport.
 int hashCode()
          Retrurns the hashcode of the IATA/ICAO values.
 boolean hasPosition()
          Returns if the position of this Airport has been set.
 void removeAirlineCode(String aCode)
          Removes an airline from the list of airlines associated with this Airport.
 void setADSE(boolean hasADSE)
          Sets whether this airport has ADSE-X radar.
 void setAirlines(Collection<String> airlines)
          Resets the list of Airlines associated with this Airport.
 void setAltitude(int alt)
          Sets this Airport's altitude.
 void setIATA(String code)
          Sets this Airport's IATA code.
 void setICAO(String code)
          Sets this Airport's ICAO code.
 void setLocation(double lat, double lng)
          Sets this airport's location.
 void setMagVar(double mv)
          Sets this airport's magnetic variation.
 void setName(String name)
          Sets this airport's name.
 void setRegion(String code)
          Sets this airport's ICAO region.
 void setTZ(String tzID)
          Sets this airport's Time Zone.
 void setTZ(TZInfo tz)
          Set this airport's Time Zone.
 String toString()
          Displays the airport name and IATA code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

IATA

public static final int IATA
See Also:
Constant Field Values

ICAO

public static final int ICAO
See Also:
Constant Field Values

CODETYPES

public static final String[] CODETYPES
Airport Code types.


ALL

public static final Airport ALL
Special airport object for "All Airports"

Constructor Detail

Airport

public Airport(String iata,
               String icao,
               String name)
Create a new Airport object.

Parameters:
iata - The airport's IATA code
icao - The airport's ICAO code
name - The airport's name
Throws:
NullPointerException - If the IATA or ICAO codes are null

Airport

public Airport(String name)
Create a new Airport object.

Parameters:
name - The airport name
Method Detail

setLocation

public void setLocation(double lat,
                        double lng)
Sets this airport's location.

Parameters:
lat - This airport's latitude
lng - This airport's longitude

setTZ

public void setTZ(TZInfo tz)
Set this airport's Time Zone.

Parameters:
tz - A Time Zone wrapper for the time zone
See Also:
getTZ()

setTZ

public void setTZ(String tzID)
Sets this airport's Time Zone.

Parameters:
tzID - A valid JVM time zone ID

setMagVar

public void setMagVar(double mv)
Sets this airport's magnetic variation.

Parameters:
mv - the magnetic variation in degrees

setADSE

public void setADSE(boolean hasADSE)
Sets whether this airport has ADSE-X radar.

Parameters:
hasADSE - TRUE if ADSE-X present, otherwise FALSE

setName

public void setName(String name)
Sets this airport's name.

Parameters:
name - the airport name
See Also:
getName()

setICAO

public void setICAO(String code)
Sets this Airport's ICAO code.

Parameters:
code - the ICAO code
Throws:
NullPointerException - if code is null
See Also:
getICAO()

setIATA

public void setIATA(String code)
Sets this Airport's IATA code.

Parameters:
code - the IATA code
Throws:
NullPointerException - if code is null
See Also:
getIATA()

setRegion

public void setRegion(String code)
Sets this airport's ICAO region.

Parameters:
code - the region code
See Also:
getRegion()

setAltitude

public void setAltitude(int alt)
Sets this Airport's altitude.

Parameters:
alt - the altitude in feet MSL
See Also:
getAltitude()

getIATA

public String getIATA()
Return this airprort's IATA Code.

Returns:
The IATA code

getICAO

public String getICAO()
Return this airport's ICAO Code.

Specified by:
getICAO in interface ICAOAirport
Returns:
The ICAO code

getName

public String getName()
Return this airport's name.

Returns:
The Airport name

getAltitude

public int getAltitude()
Return this airport's altitude.

Specified by:
getAltitude in interface GeospaceLocation
Returns:
the altitude in feet MSL

getRegion

public String getRegion()
Returns the ICAO region containing this Airport.

Returns:
the region code

getTZ

public TZInfo getTZ()
Returns this airport's time zone.

Returns:
the Airport's time zone

getMagVar

public double getMagVar()
Returns this airport's magnetic variation.

Returns:
the magnetic variation in degrees

getPosition

public GeoPosition getPosition()
Returns this airport's latitude and longitude.

Returns:
a GeoPosition object containing the airport's position

getLatitude

public final double getLatitude()
Return this airport's latitude.

Specified by:
getLatitude in interface GeoLocation
Returns:
this airport's latitude in degrees (and some fraction thereof)
See Also:
GeoPosition.getLatitude()

getLongitude

public final double getLongitude()
Return this airport's longitude.

Specified by:
getLongitude in interface GeoLocation
Returns:
This airport's longitude in degrees (and some fraction thereof)
See Also:
GeoPosition.getLongitude()

getADSE

public boolean getADSE()
Returns whether this Airport has ADSE-X radar.

Returns:
TRUE if ADSE-X radar present, otherwise FALSE
See Also:
setADSE(boolean)

compareTo

public int compareTo(Airport a2)
Sort the airports by comparing their IATA codes.

Specified by:
compareTo in interface Comparable<Airport>

getComboAlias

public String getComboAlias()
Description copied from interface: ComboAlias
Returns the alias to use in the HTML <OPTION> element.

Specified by:
getComboAlias in interface ComboAlias
Returns:
The alias for this entry

getComboName

public String getComboName()
Description copied from interface: ComboAlias
Returns the visible name to use in the HTML <OPTION> element.

Specified by:
getComboName in interface ComboAlias
Returns:
The visible name for this entry

addAirlineCode

public void addAirlineCode(String aCode)
Adds an airline to the list of airlines associated with this Airport.

Parameters:
aCode - The airline code
Throws:
NullPointerException - if aCode is null
See Also:
removeAirlineCode(String), setAirlines(Collection), Airline.getCode()

removeAirlineCode

public void removeAirlineCode(String aCode)
Removes an airline from the list of airlines associated with this Airport.

Parameters:
aCode - The airline code
Throws:
NullPointerException - if aCode is null
See Also:
addAirlineCode(String), setAirlines(Collection), Airline.getCode()

setAirlines

public void setAirlines(Collection<String> airlines)
Resets the list of Airlines associated with this Airport.

Parameters:
airlines - a Collection of Airline codes
See Also:
addAirlineCode(String), getAirlineCodes()

getAirlineCodes

public Collection<String> getAirlineCodes()
Returns a list codes for the airlines associated with this Airport.

Returns:
The unsorted list of airline codes
See Also:
Airline.getCode()

hasAirlineCode

public boolean hasAirlineCode(String code)
Determines if a particular airline services this Airport.

Parameters:
code - The airline code
Returns:
If the airline is associated with this airport
See Also:
Airline.getCode()

hasPosition

public boolean hasPosition()
Returns if the position of this Airport has been set.

Returns:
TRUE if the position has been set, otherwise FALSE

getIconColor

public String getIconColor()
Return the default Google Maps icon color.

Specified by:
getIconColor in interface MarkerMapEntry
Returns:
org.deltava.beans.MapEntry.GREEN

getPaletteCode

public int getPaletteCode()
Returns the Google Earth palette code.

Specified by:
getPaletteCode in interface IconMapEntry
Returns:
2

getIconCode

public int getIconCode()
Returns the Google Earth icon code.

Specified by:
getIconCode in interface IconMapEntry
Returns:
48

getInfoBox

public String getInfoBox()
Returns the default Google Maps infobox text.

Specified by:
getInfoBox in interface MapEntry
Returns:
an HTML String

equals

public boolean equals(Object o2)
Compares airports by ensuring that both the IATA and ICAO code are the same. This leaves the possibility open of airports having the same IATA code but different ICAO codes.

Overrides:
equals in class Object

hashCode

public final int hashCode()
Retrurns the hashcode of the IATA/ICAO values.

Overrides:
hashCode in class Object

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

toString

public String toString()
Displays the airport name and IATA code.

Overrides:
toString in class Object


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