Class Route

java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.event.Route
All Implemented Interfaces:
Serializable, Comparable<Object>, ComboAlias, IDBean, RoutePair, ViewEntry, Cacheable

public class Route extends DatabaseBean implements ComboAlias, ViewEntry, RoutePair
A class to store information about a Flight Route for an Online Event.
Since:
1.0
Version:
8.6
Author:
Luke
See Also:
  • Constructor Details

    • Route

      public Route(int eventID, String route)
      Creates a new Event Route.
      Parameters:
      eventID - the Event database ID
      route - the flight route
  • Method Details

    • getAirportA

      public Airport getAirportA()
      Returns the arrival Airport for this Flight Route.
      Specified by:
      getAirportA in interface RoutePair
      Returns:
      the Arrival airport object
      See Also:
    • getAirportD

      public Airport getAirportD()
      Returns the departure Airport for this Flight Route.
      Specified by:
      getAirportD in interface RoutePair
      Returns:
      the Departure airport object
      See Also:
    • getDistance

      public int getDistance()
      Description copied from interface: RoutePair
      Returns the distance between the Airports.
      Specified by:
      getDistance in interface RoutePair
      Returns:
      the distance in miles
    • getName

      public String getName()
      Returns the Route name.
      Returns:
      the name, or the airports if null
      See Also:
    • getRoute

      public String getRoute()
      Returns the flight plan for this route.
      Returns:
      the flight plan
      See Also:
    • getActive

      public boolean getActive()
      Returns whether the Route is active.
      Returns:
      TRUE if the Route is available for signup, otherwise FALSE
    • getIsRNAV

      public boolean getIsRNAV()
      Returns whether this is an RNAV routing.
      Returns:
      TRUE if RNAV, otherwise FALSE
    • isAvailable

      public boolean isAvailable()
      Returns if there are still signup slots available for this route.
      Returns:
      TRUE if signups are less than maximum signups, otherwise FALSE
    • getSignups

      public int getSignups()
      Returns the number of Pilots signed up for this Route.
      Returns:
      the number of Pilots signed up
      See Also:
    • getMaxSignups

      public int getMaxSignups()
      Returns the maximum number of signups for this Route.
      Returns:
      the maximum number of Pilots signed up
      See Also:
    • getRouteID

      public int getRouteID()
      Returns the identifier for this Route.
      Returns:
      the Route identifier
      See Also:
    • setAirportA

      public void setAirportA(Airport a)
      Updates the Arrival airport.
      Parameters:
      a - the new arrival Airport object
      See Also:
    • setAirportD

      public void setAirportD(Airport a)
      Updates the Departure airport.
      Parameters:
      a - the new departure Airport object
      See Also:
    • setActive

      public void setActive(boolean isActive)
      Updates whether the Route is Active.
      Parameters:
      isActive - TRUE if the Route is active, otherwise FALSE
    • setIsRNAV

      public void setIsRNAV(boolean isRNAV)
      Updates whether this is an RNAV route.
      Parameters:
      isRNAV - TRUE if RNAV, otherwise FALSE
    • setRoute

      public void setRoute(String route)
      Updates the flight route for this Route.
      Parameters:
      route - the waypoints
      See Also:
    • setName

      public void setName(String name)
      Updates the route name.
      Parameters:
      name - the name
      See Also:
    • setSignups

      public void setSignups(int count)
      Updates the number of Pilots signed up for this Route.
      Parameters:
      count - the number of signups
      See Also:
    • setMaxSignups

      public void setMaxSignups(int maxSignups)
      Updates the maximum number of Pilots who can be signed up for this Route.
      Parameters:
      maxSignups - the maximum number of signups
      See Also:
    • setRouteID

      public void setRouteID(int id)
      Updates the Route identifier.
      Parameters:
      id - the identifier
      Throws:
      IllegalArgumentException - if id is zero or negative
    • 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
    • compareTo

      public int compareTo(Object o)
      Specified by:
      compareTo in interface Comparable<Object>
      Overrides:
      compareTo in class DatabaseBean
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class DatabaseBean
    • toString

      public String toString()
      Overrides:
      toString 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