Class TerminalRoute

java.lang.Object
org.deltava.beans.navdata.Airway
org.deltava.beans.navdata.TerminalRoute
All Implemented Interfaces:
Serializable, Comparable<Airway>, ComboAlias, GeoLocation, Route, Cacheable

public class TerminalRoute extends Airway implements ComboAlias
A bean to store SID/STAR data.
Since:
1.0
Version:
11.0
Author:
Luke
See Also:
  • Constructor Details

    • TerminalRoute

      public TerminalRoute(String icao, String name, TerminalRoute.Type type)
      Creates a new Terminal Route.
      Parameters:
      icao - the Airport ICAO code
      name - the route name
      type - the SID/STAR type
      Throws:
      NullPointerException - if icao, name or transition are null
    • TerminalRoute

      public TerminalRoute(Airport a, String name, TerminalRoute.Type type)
      Creates a new Terminal Route.
      Parameters:
      a - the Airport
      name - the route name
      type - the type
  • Method Details

    • isNameValid

      public static boolean isNameValid(String name)
      Checks if a route waypoint is really a SID/STAR name.
      Parameters:
      name - the waypoint code
      Returns:
      TRUE if a SID/STAR, otherwise FALSE
    • makeGeneric

      public static String makeGeneric(String name)
      Utlity method to convert the SID/STAR name to a generic name using a percent sign so that mySQL can select any revision of the procedure.
      Parameters:
      name - the SID/STAR name
      Returns:
      a genericized name with the digit replaced by a percent sign
    • getICAO

      public String getICAO()
      Returns the Airport's ICAO code.
      Returns:
      the ICAO code
    • getName

      public String getName()
      Returns the SID/STAR name.
      Returns:
      the name
    • getCanPurge

      public boolean getCanPurge()
      Returns whether this route can be purged from the database.
      Returns:
      TRUE if it can be purged, otherwise FALSE
    • getTransition

      public String getTransition()
      Returns the name of the transition waypoint.
      Returns:
      the transition waypoint
    • getRunway

      public String getRunway()
      Returns the runway for this Terminal Route.
      Returns:
      the runway name, or ALL
    • getType

      public TerminalRoute.Type getType()
      Returns the route type (SID/STAR).
      Returns:
      the route type
    • 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
    • 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
    • getWaypoints

      public Collection<NavigationDataBean> getWaypoints(String transition)
      Returns the waypoints to a partial transition point.
      Parameters:
      transition - the transition waypoint code
      Returns:
      a Collection of NavigationDataBeans
    • getCode

      public String getCode()
      Returns the SID/STAR code.
      Overrides:
      getCode in class Airway
      Returns:
      the code
    • setName

      public void setName(String name)
      Updates the Route name.
      Parameters:
      name - the name
      Throws:
      NullPointerException - if name is null
    • setSequence

      public void setSequence(int seq)
      Updates the internal ID used to map Terminal Routes to waypoints.
      Parameters:
      seq - the sequence ID
    • setCanPurge

      public void setCanPurge(boolean canPurge)
      Updates whether this route can be purged from the database.
      Parameters:
      canPurge - TRUE if the route can be purged, otherwise FALSE
    • setRunway

      public void setRunway(String runway)
      Updates the runway associated with this Terminal Route.
      Parameters:
      runway - the runway name
    • setTransition

      public void setTransition(String waypoint)
      Updates the transition waypoint for this Terminal Route.
      Parameters:
      waypoint - the waypoint code
      Throws:
      NullPointerException - if waypoint is null
    • compareTo

      public final int compareTo(Airway a2)
      Compares two terminal routes by comparing their names and transition waypoints.
      Specified by:
      compareTo in interface Comparable<Airway>
      Overrides:
      compareTo in class Airway
      See Also:
    • equals

      public boolean equals(Object o)
      Checks for equality by comparing names.
      Overrides:
      equals in class Airway
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Airway
    • toString

      public String toString()
      Returns the name, transition and runway.
      Overrides:
      toString in class Airway