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
A class to store information about a Flight Route for an Online Event.
- Since:
- 1.0
- Version:
- 8.6
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.deltava.beans.schedule.RoutePair
RoutePair.RoutePairImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanbooleanReturns whether the Route is active.Returns the arrival Airport for this Flight Route.Returns the departure Airport for this Flight Route.Returns the alias to use in the HTML <OPTION> element.Returns the visible name to use in the HTML <OPTION> element.intReturns the distance between the Airports.booleanReturns whether this is an RNAV routing.intReturns the maximum number of signups for this Route.getName()Returns the Route name.getRoute()Returns the flight plan for this route.intReturns the identifier for this Route.Returns the CSS class for this object if rendered in a view table.intReturns the number of Pilots signed up for this Route.booleanReturns if there are still signup slots available for this route.voidsetActive(boolean isActive) Updates whether the Route is Active.voidUpdates the Arrival airport.voidUpdates the Departure airport.voidsetIsRNAV(boolean isRNAV) Updates whether this is an RNAV route.voidsetMaxSignups(int maxSignups) Updates the maximum number of Pilots who can be signed up for this Route.voidUpdates the route name.voidUpdates the flight route for this Route.voidsetRouteID(int id) Updates the Route identifier.voidsetSignups(int count) Updates the number of Pilots signed up for this Route.toString()Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, getHexID, getID, hashCode, setID, validateID, validateIDMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.deltava.beans.schedule.RoutePair
createKey, getAirports, getFlightType, includes, isPopulated, matches, midPoint
-
Constructor Details
-
Route
Creates a new Event Route.- Parameters:
eventID- the Event database IDroute- the flight route
-
-
Method Details
-
getAirportA
Returns the arrival Airport for this Flight Route.- Specified by:
getAirportAin interfaceRoutePair- Returns:
- the Arrival airport object
- See Also:
-
getAirportD
Returns the departure Airport for this Flight Route.- Specified by:
getAirportDin interfaceRoutePair- Returns:
- the Departure airport object
- See Also:
-
getDistance
public int getDistance()Description copied from interface:RoutePairReturns the distance between the Airports.- Specified by:
getDistancein interfaceRoutePair- Returns:
- the distance in miles, or -1 if not populated
-
getName
Returns the Route name.- Returns:
- the name, or the airports if null
- See Also:
-
getRoute
-
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
Updates the Arrival airport.- Parameters:
a- the new arrival Airport object- See Also:
-
setAirportD
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
Updates the flight route for this Route.- Parameters:
route- the waypoints- See Also:
-
setName
-
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
Description copied from interface:ComboAliasReturns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboNamein interfaceComboAlias- Returns:
- The visible name for this entry
-
getComboAlias
Description copied from interface:ComboAliasReturns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAliasin interfaceComboAlias- Returns:
- The alias for this entry
-
compareTo
- Specified by:
compareToin interfaceComparable<Object>- Overrides:
compareToin classDatabaseBean
-
equals
- Overrides:
equalsin classDatabaseBean
-
toString
-
getRowClassName
Description copied from interface:ViewEntryReturns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassNamein interfaceViewEntry- Returns:
- the CSS class name, or NULL if none
-