Class NavigationDataBean

java.lang.Object
org.deltava.beans.navdata.NavigationDataBean
All Implemented Interfaces:
Serializable, Cloneable, Comparable<NavigationDataBean>, GeoLocation, IconMapEntry, MapEntry, MarkerMapEntry, Cacheable
Direct Known Subclasses:
AirportLocation, Gate, Intersection, NavigationFrequencyBean

public abstract class NavigationDataBean extends Object implements Cloneable, Cacheable, Comparable<NavigationDataBean>, MarkerMapEntry, IconMapEntry
A bean to store common properties for Navigation Database objects.
Since:
1.0
Version:
11.5
Author:
Luke
See Also:
  • Constructor Details

    • NavigationDataBean

      public NavigationDataBean(Navaid type, double lat, double lon)
      Creates a new Navigation Object.
      Parameters:
      type - the object type code
      lat - the latitude in degrees
      lon - the longitude in degrees
      See Also:
  • Method Details

    • getCode

      public String getCode()
      Returns the object's code.
      Returns:
      the navigation object code
      See Also:
    • getName

      public String getName()
      Returns the object's name.
      Returns:
      the name
      See Also:
    • 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
    • getPosition

      public GeoPosition getPosition()
      Returns the object's position.
      Returns:
      the GeoPosition of this object
      See Also:
    • getType

      public final Navaid getType()
      Returns the object's type.
      Returns:
      the object type code
    • getRegion

      public final String getRegion()
      Returns the ICAO region code for this entry.
      Returns:
      the region code
      See Also:
    • getAirway

      public String getAirway()
      Returns if this waypoint is on an Airway.
      Returns:
      the airway code
    • isInTerminalRoute

      public boolean isInTerminalRoute()
      Returns whether this waypoint is part of a terminal route.
      Returns:
      TRUE if part of a Terminal Route, otherwise FALSE
    • setCode

      public void setCode(String code)
      Updates the object's code.
      Parameters:
      code - the code
      See Also:
    • setName

      public void setName(String name)
      Updates the object's name.
      Parameters:
      name - the name
      Throws:
      NullPointerException - if name is null
      See Also:
    • setRegion

      public void setRegion(String rCode)
      Updates the ICAO region code for this entry.
      Parameters:
      rCode - the ICAO region code
      See Also:
    • setAirway

      public void setAirway(String code)
      Updates if this entry is on an airway.
      Parameters:
      code - the airway code, or null if none
    • compareTo

      public int compareTo(NavigationDataBean nb2)
      Compares two objects by comparing their codes. If the codes are equal, then their item types and then distances from point 0,0 are compared.
      Specified by:
      compareTo in interface Comparable<NavigationDataBean>
    • getHTMLTitle

      protected String getHTMLTitle()
      Helper method to return the item type and code for HTML infoboxes.
      Returns:
      the HTML-formatted code and description
      See Also:
    • getHTMLPosition

      protected String getHTMLPosition()
      Helper method to return the Latitude/Longitude for HTML infoboxes.
      Returns:
      the HTML-formatted latitude/longitude
      See Also:
    • hashCode

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

      public boolean equals(Object o2)
      Overrides:
      equals 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
    • toString

      public String toString()
      Returns this navigation aid's unique ID in a format that matches the ACARS dispatch client. Changing this format will probably break the dispatch client!
      Overrides:
      toString in class Object
    • clone

      public Object clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • create

      public static NavigationDataBean create(Navaid type, double lat, double lng)
      Creates a bean from a type, latitude and longitude.
      Parameters:
      type - the navigation aid type
      lat - the latitude in degrees
      lng - the longitude in degrees
      Returns:
      a NavigationDataBean, or null if the type is unknown
    • create

      public static NavigationDataBean create(String id)
      Creats a bean from a unique ID that matches the ACARS dispatch client.
      Parameters:
      id - the ID.
      Returns:
      a NavigationDataBean
    • isCoordinates

      public static CodeType isCoordinates(String code)
      Returns whether a waypoint code is actually encoded coordinates.
      Parameters:
      code - the waypoint code
      Returns:
      TRUE if in XXYYN format or XXNYYYE format, otherwise FALSE