Class Airport

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

A class for storing airport information.
Since:
1.0
Version:
11.0
Author:
Luke
See Also:
  • Field Details

    • ALL

      public static final Airport ALL
      Special airport object for "All Airports".
  • Constructor Details

    • 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 Details

    • 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:
    • setCountry

      public void setCountry(Country c)
      Sets this airport's Country.
      Parameters:
      c - the Country
      See Also:
    • setMaximumRunwayLength

      public void setMaximumRunwayLength(int len)
      Updates the length of the longest runway at this Airport.
      Parameters:
      len - the length in feet
      See Also:
    • setASDE

      public void setASDE(boolean hasASDE)
      Sets whether this airport has ASDE-X radar.
      Parameters:
      hasASDE - TRUE if ASDE-X present, otherwise FALSE
      See Also:
    • setGateData

      public void setGateData(boolean hasData)
      Sets whether this airport has gate data configured.
      Parameters:
      hasData - TRUE if gate data configured, otherwise FALSE
      See Also:
    • setIsSchengen

      public void setIsSchengen(boolean isSZ)
      Sets whether this Airport is in the Schengen Zone.
      Parameters:
      isSZ - TRUE if in the Schengen Zone, otherwise FALSE
      See Also:
    • setHasPFI

      public void setHasPFI(boolean hasPFI)
      Sets whether this Airport has a US Pre-Flight Inspection station.
      Parameters:
      hasPFI - TRUE if a PFI present, otherwise FALSE
    • setHasFictionalCode

      public void setHasFictionalCode(boolean isFictional)
      Sets whether this Airport is using a fictional IATA code, for non-extant Airports.
      Parameters:
      isFictional - TRUE if a fictional code, otherwise FALSE
    • setName

      public void setName(String name)
      Sets this airport's name.
      Parameters:
      name - the airport name
      See Also:
    • 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:
    • 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:
    • setRegion

      public void setRegion(String code)
      Sets this airport's ICAO region.
      Parameters:
      code - the region code
      See Also:
    • setAltitude

      public void setAltitude(int alt)
      Sets this Airport's altitude.
      Parameters:
      alt - the altitude in feet MSL
      See Also:
    • setSupercededAirport

      public void setSupercededAirport(String iata)
      Updates the superceded airport code for this airport.
      Parameters:
      iata - the airport IATA code
      See Also:
    • getIATA

      public String getIATA()
      Return this airprort's IATA Code.
      Returns:
      The IATA code
    • getICAO

      public String getICAO()
      Description copied from interface: ICAOAirport
      Returns the ICAO code for the airport.
      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()
      Description copied from interface: GeospaceLocation
      Returns the altitude of the location above MSL.
      Specified by:
      getAltitude in interface GeospaceLocation
      Returns:
      the altitude in feet
    • 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
    • getCountry

      public Country getCountry()
      Returns this airport's country.
      Returns:
      the Country
    • getState

      public State getState()
      Returns the State this airport is located in.
      Returns:
      a US State, or null
    • getMaximumRunwayLength

      public int getMaximumRunwayLength()
      Returns the maximum length of all runways at this airport.
      Returns:
      the length in feet of the longest runway
      See Also:
    • getSupercededAirport

      public String getSupercededAirport()
      Returns the IATA code of any former Airports replaced by this Airport.
      Returns:
      the IATA code, or null if none
      See Also:
    • getPosition

      public GeoPosition getPosition()
      Returns this airport's latitude and longitude.
      Returns:
      a GeoPosition object containing the airport's position
    • getIsSchengen

      public boolean getIsSchengen()
      Returns whether this Airport is in the Schengen Zone.
      Returns:
      TRUE if in the Schengen Zone, otherwise FALSE
      See Also:
    • getHasPFI

      public boolean getHasPFI()
      Returns whether this Airport has a US customs pre-flight inspection station.
      Returns:
      TRUE if PFI present, otherwise FALSE
      See Also:
    • getHasFictionalCode

      public boolean getHasFictionalCode()
      Returns whether the Airport has a fictional IATA code, for non-existent airports.
      Returns:
      TRUE if the code is fictional, otherwise FALSE
    • getLatitude

      public final double getLatitude()
      Description copied from interface: GeoLocation
      Returns the latitude of this location.
      Specified by:
      getLatitude in interface GeoLocation
      Returns:
      the latitude in degrees
    • getLongitude

      public final double getLongitude()
      Description copied from interface: GeoLocation
      Returns the longitude of this location.
      Specified by:
      getLongitude in interface GeoLocation
      Returns:
      the longitude in degrees
    • getASDE

      public boolean getASDE()
      Returns whether this Airport has ASDE-X radar.
      Returns:
      TRUE if ASDE-X radar present, otherwise FALSE
      See Also:
    • getGateData

      public boolean getGateData()
      Returns whether this Airport has gate data configured
      Returns:
      TRUE if gate data configured, otherwise FALSE
      See Also:
    • compareTo

      public int compareTo(Airport a2)
      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

      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:
    • 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:
    • 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:
    • 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:
    • 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()
      Description copied from interface: MarkerMapEntry
      Returns the icon color for this entry if displayed in a Google Map.
      Specified by:
      getIconColor in interface MarkerMapEntry
      Returns:
      the icon color
    • getPaletteCode

      public int getPaletteCode()
      Description copied from interface: IconMapEntry
      Returns the Google Earth palette code.
      Specified by:
      getPaletteCode in interface IconMapEntry
      Returns:
      the palette code
    • getIconCode

      public int getIconCode()
      Description copied from interface: IconMapEntry
      Returns the Google Earth icon code.
      Specified by:
      getIconCode in interface IconMapEntry
      Returns:
      the icon code within the palette
    • getInfoBox

      public String getInfoBox()
      Description copied from interface: MapEntry
      Returns the text to display in this marker's infobox if displayed in a Google Map.
      Specified by:
      getInfoBox in interface MapEntry
      Returns:
      the infobox HTML text, or null if no infobox to be displayed
    • equals

      public boolean equals(Object o2)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      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()
      Overrides:
      toString in class 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
    • clone

      public Object clone()
      Overrides:
      clone in class Object