|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfaa.tg.units.AMeasure
faa.tg.units.Angle
faa.tg.units.Longitude
public class Longitude
Longitude represents the object for measuring units of Longitude.When parsing an input string, if the longitude direction is not specified, then the longitude is assumed to be in the western hemisphere (negative). This is for compatibility with NAS longitude imports.
Eastern hemisphere longitudes can be specified by preceding the longitude string with a "+" OR by appending a directional indicator of "E" to the longitude string.
See section 5.6 of the Detailed Design Document for a discussion of design issues. See the source: Longitude.java
AUnits,
AMeasure,
Angle,
Latitude,
Serialized Form| Field Summary | |
|---|---|
static java.lang.String |
CVS_VERSION_ID
The CVS Version ID |
static Longitude |
MAX
|
static Longitude |
MIN
|
(package private) static long |
serialVersionUID
|
static Longitude |
ZERO
|
| Fields inherited from class faa.tg.units.Angle |
|---|
D180_DIV_PI, DEG_1, DEG_180, DEG_270, DEG_30, DEG_330, DEG_5, DEG_60, DEG_90, DEG_NEG180, DEG_NEG270, DEG_NEG30, DEG_NEG5, DEG_NEG90, DEG_PER_RAD, NEG_NINETY_DEG, NEG_ONEEIGHTY_DEG, NINETY_DEG, ONEEIGHTY_DEG, PI, PI_DIV_180, PI_DIV_2, PI_DIV_4, PI_MUL_2, PI_MUL_4, RAD_PER_DEG, THIRTY_DEG, THREETHIRTY_DEG, TWOSEVENTY_DEG |
| Fields inherited from class faa.tg.units.AMeasure |
|---|
DEC0, DEC0_, DEC00, DEC000, DEC1, DEC1_, DEC12, DEC12_, DEC1L, DEC1L_, DEC2, DEC2_, DEC3, DEC3_, DEC4, DEC4_, DEC5, DEC5_, DEC6, DEC6_, DEC7, DEC7_, DEC9, DEC9_, itsValue, TIME_FRACTION |
| Constructor Summary | |
|---|---|
Longitude(DMSString dms)
Constructor for the Longitude class that takes a DMSString. |
|
Longitude(double theValue,
AngleUnits theUnits)
Constructor for the Longitude class: normalizes the range if outside the normal longitude range. |
|
Longitude(Longitude origLon,
LongitudeRate rate,
Time timeToTravel)
Constructor for the Longitude class that uses a reference longitude, a longitude rate and a time interval to travel at the specified rate. |
|
Longitude(java.lang.String dms)
Constructor for the Longitude class that takes a string with degrees or degrees-minutes-seconds in DD-MM-SS[.SSS] (and a few other formats). |
|
| Method Summary | |
|---|---|
Longitude |
add(Longitude addend)
This summation method adds a value with like units. |
Longitude |
average(Longitude lon2)
This method returns the average of this and another Longitude. |
private static double |
avg(double deg1,
double deg2)
Component average used by average() for angles in [0,360] range. |
static java.lang.String |
convertIfNasStandard(java.lang.String lonString)
Converts an unsigned, non-directional value to a negative value. |
boolean |
eq(Longitude theMeasure)
This method provides a test for equality. |
boolean |
ge(Longitude theMeasure)
This method provides a test for greater than / equal to. |
boolean |
gt(Longitude theMeasure)
This method provides a test for greater than. |
boolean |
le(Longitude theMeasure)
This method provides a test for less than / equal to. |
boolean |
lt(Longitude theMeasure)
This method provides a test for less than. |
static void |
main(java.lang.String[] args)
Test case for Longitude that displays parsed parameter as degrees, as a DDD-MM-SS string, and as radians. |
static double |
normalizeRange(double value,
AUnits units)
Normalizes the Longitude to be in the range: -180 < value <= 180. |
double |
ratio(Longitude val)
This division method produces a dimensionless ratio of like measures. |
Longitude |
sub(Longitude subtrahend)
Returns the difference of this value and the parameter's value. |
java.lang.String |
toDmsString()
Converts Longitude to String of form DDD-MM-SS.SSSd (~0.1 ft precision). |
private static double |
toPositive(double deg)
Converts angles in [-180,+180] range to [0,360] range. |
java.lang.String |
toString()
returns the String representation of this object in the form with which it was created. |
java.lang.String |
toXpvdString()
Converts Longitude to a string of the format used as XPVD input: DDDMMSS. |
| Methods inherited from class faa.tg.units.Angle |
|---|
abs, add, aeq, as, average, cos, diff, eq, ge, gt, isBetween, le, lt, parseDmsString, ratio, reciprocalAngle, removeDelimiters, sin, sub, tan, toRadialString, toText |
| Methods inherited from class faa.tg.units.AMeasure |
|---|
absoluteValue, add, as, as, clone, compareTo, debug, div, eq, equals, ge, getAUnit, getCanonicalUnit, getCanonicalValue, getInitialUnit, getUnitClass, gt, hashCode, isBetween, le, lt, mul, ratio, sub, toAMeasure, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final long serialVersionUID
public static final java.lang.String CVS_VERSION_ID
public static final Longitude ZERO
public static final Longitude MAX
public static final Longitude MIN
| Constructor Detail |
|---|
public Longitude(double theValue,
AngleUnits theUnits)
theValue - The magnitude of Longitude as a double.theUnits - The units of the value that will be stored (ex: km).Units
public Longitude(java.lang.String dms)
throws java.lang.NumberFormatException
This assumes that if the input is an unsigned, non-directional value then the longitude is in the western hemisphere (negative). The string must specify positive or "E" for a longitude in the eastern hemisphere.
dms - A String containing a DMS string.
java.lang.NumberFormatExceptionfor parsable String formats.
public Longitude(DMSString dms)
throws java.lang.NumberFormatException
dms - A string of type DMSString.
java.lang.NumberFormatException
public Longitude(Longitude origLon,
LongitudeRate rate,
Time timeToTravel)
origLon - The reference longitude to travel from.rate - The rate of change of the longitude.timeToTravel - The time interval to travel at the specified rate.| Method Detail |
|---|
public static java.lang.String convertIfNasStandard(java.lang.String lonString)
throws java.lang.NumberFormatException,
java.lang.NullPointerException
lonString - A string of type String.
java.lang.NullPointerException - Null text string.
java.lang.NumberFormatException - Empty text string.public Longitude add(Longitude addend)
addend - The unit of measure to add to this measure.
public Longitude sub(Longitude subtrahend)
subtrahend - The longitude to subtract from this measure.
public Longitude average(Longitude lon2)
private static double toPositive(double deg)
private static double avg(double deg1,
double deg2)
public double ratio(Longitude val)
public boolean eq(Longitude theMeasure)
public boolean lt(Longitude theMeasure)
public boolean gt(Longitude theMeasure)
public boolean ge(Longitude theMeasure)
public boolean le(Longitude theMeasure)
public static double normalizeRange(double value,
AUnits units)
public java.lang.String toDmsString()
toDmsString in class Anglepublic java.lang.String toString()
toString in class AngleUnitspublic java.lang.String toXpvdString()
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||