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 TypeMethodDescriptionint
boolean
boolean
Returns 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.int
Returns the distance between the Airports.boolean
Returns whether this is an RNAV routing.int
Returns the maximum number of signups for this Route.getName()
Returns the Route name.getRoute()
Returns the flight plan for this route.int
Returns the identifier for this Route.Returns the CSS class for this object if rendered in a view table.int
Returns the number of Pilots signed up for this Route.boolean
Returns if there are still signup slots available for this route.void
setActive
(boolean isActive) Updates whether the Route is Active.void
Updates the Arrival airport.void
Updates the Departure airport.void
setIsRNAV
(boolean isRNAV) Updates whether this is an RNAV route.void
setMaxSignups
(int maxSignups) Updates the maximum number of Pilots who can be signed up for this Route.void
Updates the route name.void
Updates the flight route for this Route.void
setRouteID
(int id) Updates the Route identifier.void
setSignups
(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, validateID
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.deltava.beans.schedule.RoutePair
createKey, getAirports, getFlightType, includes, isPopulated, matches
-
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:
getAirportA
in interfaceRoutePair
- Returns:
- the Arrival airport object
- See Also:
-
getAirportD
Returns the departure Airport for this Flight Route.- Specified by:
getAirportD
in interfaceRoutePair
- 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 interfaceRoutePair
- Returns:
- the distance in miles
-
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:ComboAlias
Returns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboName
in interfaceComboAlias
- Returns:
- The visible name for this entry
-
getComboAlias
Description copied from interface:ComboAlias
Returns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAlias
in interfaceComboAlias
- Returns:
- The alias for this entry
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Object>
- Overrides:
compareTo
in classDatabaseBean
-
equals
- Overrides:
equals
in classDatabaseBean
-
toString
-
getRowClassName
Description copied from interface:ViewEntry
Returns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassName
in interfaceViewEntry
- Returns:
- the CSS class name, or NULL if none
-