Class Airway
java.lang.Object
org.deltava.beans.navdata.Airway
- All Implemented Interfaces:
Serializable, Comparable<Airway>, GeoLocation, Route, Cacheable
- Direct Known Subclasses:
OceanicTrack, TerminalRoute
A bean to store Airway names and waypoint data. Since there can be multiple Airways across the world with the
same code, each intersection can be flagged as "end of sequence" deliniating the end of a particular airway sequence.
- Since:
- 1.0
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected final LinkedList<NavigationDataBean> Waypoints.Fields inherited from interface GeoLocation
ALL, DEGREE_FEET, DEGREE_MILES, FEET_MILES, LAT_DIRECTIONS, LATITUDE, LON_DIRECTIONS, LONGITUDE, RADIAN_MILES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a waypoint to the Airway route.cacheKey()Returns the cache key for this object.intbooleanReturns whether this Airway contains a particular waypoint.booleanprotected intFinds a waypoint in this Airway.getCode()Returns the airway code.doubleReturns the latitude of the middle of the Airway.doubleReturns the longitude of the middle of the Airway.getRoute()Returns the Airway route.intReturns the sequence number, used to differentiate airways with different locations but the same code.intgetSize()Returns the number of waypoints in the airway.Returns the waypoints for this Airway.getWaypoints(String start, String end) Returns a subset of waypoints for this Airway between two waypoints.inthashCode()booleanReturns if this Airway is a high-level Airway.booleanReturns if this Airway is a low-level Airway.voidUpdates the Airway code.voidsetHighLevel(boolean isHigh) Marks this Airway as a high-level Airway.voidsetLowLevel(boolean isLow) Marks this Airway as a low-level Airway.toString()Methods inherited from interface GeoLocation
distanceFeet, distanceTo
-
Field Details
-
_awseq
protected int _awseq -
_waypoints
Waypoints.
-
-
Constructor Details
-
Airway
Creates a new Airway bean.- Parameters:
code- the airway codeseq- the airway sequence code- Throws:
NullPointerException- if code is null
-
-
Method Details
-
getCode
-
getSequence
public int getSequence()Returns the sequence number, used to differentiate airways with different locations but the same code.- Returns:
- the squence
-
getSize
-
isLowLevel
public boolean isLowLevel()Returns if this Airway is a low-level Airway.- Returns:
- TRUE if a low-level airway, otherwise FALSE
-
isHighLevel
public boolean isHighLevel()Returns if this Airway is a high-level Airway.- Returns:
- TRUE if a high-level airway, otherwise FALSE
-
getWaypoints
Returns the waypoints for this Airway. The returned collection is mutable.- Specified by:
getWaypointsin interfaceRoute- Returns:
- an ordered Collection of waypoints
- See Also:
-
getLatitude
public double getLatitude()Returns the latitude of the middle of the Airway.- Specified by:
getLatitudein interfaceGeoLocation- Returns:
- the latitude in degrees
-
getLongitude
public double getLongitude()Returns the longitude of the middle of the Airway.- Specified by:
getLongitudein interfaceGeoLocation- Returns:
- the longitude in degrees
-
find
Finds a waypoint in this Airway.- Parameters:
code- the waypoint code- Returns:
- the offset within the waypoints, or -1 if not found
-
contains
Returns whether this Airway contains a particular waypoint.- Parameters:
code- the waypoint code- Returns:
- TRUE if found, otherwise FALSE
-
getWaypoints
Returns a subset of waypoints for this Airway between two waypoints.- Parameters:
start- the starting waypoint codeend- the ending waypoint code- Returns:
- a List of waypoint codes
- Throws:
NullPointerException- if start or end are null
-
getRoute
-
setCode
Updates the Airway code.- Parameters:
code- the code- Throws:
NullPointerException- if code is null
-
setLowLevel
public void setLowLevel(boolean isLow) Marks this Airway as a low-level Airway.- Parameters:
isLow- TRUE if low-level, otherwise FALSE
-
setHighLevel
public void setHighLevel(boolean isHigh) Marks this Airway as a high-level Airway.- Parameters:
isHigh- TRUE if high-level, otherwise FALSE
-
equals
-
hashCode
-
toString
-
cacheKey
-