faa.tg.units
Class TrueAirspeed

java.lang.Object
  extended by faa.tg.units.AMeasure
      extended by faa.tg.units.Speed
          extended by faa.tg.units.TrueAirspeed
All Implemented Interfaces:
GenericSpeed, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AMeasure>

public class TrueAirspeed
extends Speed
implements GenericSpeed

 TrueAirspeed defines objects used to quantify a measure of an aircraft's
 airspeed, relative to the air mass.  Because TrueAirspeed values are
 relative to the air mass, they are not affected by the wind speed (unlike
 the GroundTrackSpeed, which is the actual speed relative to the ground
 surface).
 
See section 5.6 of the Detailed Design Document for a discussion of design issues.

See the source: TrueAirspeed.java

Version:
$Id: TrueAirspeed.java,v 3.10 2009/01/28 22:29:02 danaw Exp $
Author:
Tim Kimmet (modeled after Robert G. Oliver's Units Classes)
See Also:
AUnits, AMeasure, IndicatedAirspeed, Units.mPerSec, Serialized Form

Field Summary
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
static TrueAirspeed KTS_10
           
static TrueAirspeed KTS_15
           
static TrueAirspeed KTS_20
           
static TrueAirspeed KTS_35
           
(package private) static long serialVersionUID
           
static TrueAirspeed ZERO
           
 
Fields inherited from class faa.tg.units.Speed
ACCEPTABLE_VARIATION, KTS_1, KTS_25, KTS_40, KTS_5, KTS_50
 
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
TrueAirspeed(Distance linearDistTo, Time timeToTravel)
          Constructor that takes a 3-D linear distance (includes altitude difference) and a time to travel that distance.
TrueAirspeed(double theValue, SpeedUnits theUnits)
          Constructor for a measure of TrueAirspeed.
 
Method Summary
 TrueAirspeed add(TrueAirspeed theMeasure)
          This summation method adds a value with like units.
 IndicatedAirspeed asIndicatedAirspeed(LocalAtm atm)
          These methods are used to return the speed as other GenericSpeeds.
 Mach asMach(LocalAtm atm)
          These methods are used to return the speed as other GenericSpeeds.
 TrueAirspeed asTrueAirspeed(LocalAtm atm)
          These methods are used to return the speed as other GenericSpeeds.
 java.lang.String debug()
          Formats value as an easy-to-read text string that shows the value in knots followed by the the unit specification.
 boolean eq(TrueAirspeed theMeasure)
          This method provides a test for equality.
 boolean ge(TrueAirspeed theMeasure)
          This method provides a test for greater than / equal to.
 boolean gt(GenericSpeed otherSpd, LocalAtm atm)
          Convenience method for "greater than" test against other GenericSpeeds.
 boolean gt(TrueAirspeed theMeasure)
          This method provides a test for greater than.
 boolean le(TrueAirspeed theMeasure)
          This method provides a test for less than / equal to.
 boolean lt(TrueAirspeed theMeasure)
          This method provides a test for less than.
 double ratio(TrueAirspeed val)
          This division method produces a dimensionless ratio of like measures.
 TrueAirspeed sub(TrueAirspeed theMeasure)
          This subtraction method subtracts a value with like units.
 java.lang.String toString()
          Returns the String representation of this object in its original form.
 java.lang.String toText()
          Prints the speed in a standardized text value format for GenericSpeeds.
 
Methods inherited from class faa.tg.units.Speed
abs, add, aeq, as, eq, eq, ge, gt, gt, le, lt, lt, ratio, sub, toSpeed, toString, toString, travelDistance
 
Methods inherited from class faa.tg.units.AMeasure
absoluteValue, add, as, as, clone, compareTo, 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
 
Methods inherited from interface faa.tg.units.GenericSpeed
mul, toString
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

CVS_VERSION_ID

public static final java.lang.String CVS_VERSION_ID
The CVS Version ID

See Also:
Constant Field Values

ZERO

public static final TrueAirspeed ZERO

KTS_10

public static final TrueAirspeed KTS_10

KTS_15

public static final TrueAirspeed KTS_15

KTS_20

public static final TrueAirspeed KTS_20

KTS_35

public static final TrueAirspeed KTS_35
Constructor Detail

TrueAirspeed

public TrueAirspeed(double theValue,
                    SpeedUnits theUnits)
Constructor for a measure of TrueAirspeed.

Parameters:
theValue - the magnitude of TrueAirspeed as a double
theUnits - the units of the value that will be stored (ex: km)

TrueAirspeed

public TrueAirspeed(Distance linearDistTo,
                    Time timeToTravel)
Constructor that takes a 3-D linear distance (includes altitude difference) and a time to travel that distance.

Parameters:
linearDistTo - 3-D distance traveled during the time specified.
timeToTravel - the time it took to travel the specified distance.
Throws:
java.lang.ArithmeticException - if time is zero.
Method Detail

add

public TrueAirspeed add(TrueAirspeed theMeasure)
This summation method adds a value with like units. It overrides the method in the superclass and checks for like AMeasures as well as doing the cast for you.

Parameters:
theMeasure - The measurement you wish to add to this measure.
Returns:
A new TrueAirspeed with the sum of the values.

sub

public TrueAirspeed sub(TrueAirspeed theMeasure)
This subtraction method subtracts a value with like units. It overrides the method in the superclass and checks for like AMeasures as well as doing the cast for you.

Parameters:
theMeasure - The measure you wish to subtract from this measure.
Returns:
A new TrueAirspeed with the difference of the values.

ratio

public double ratio(TrueAirspeed val)
This division method produces a dimensionless ratio of like measures.

Returns:
the ratio of the two measures

eq

public boolean eq(TrueAirspeed theMeasure)
This method provides a test for equality. It overrides the method in the superclass and checks for like AMeasures as well as doing the cast for you.

Returns:
Returns boolean indicating whether values are equal.

lt

public boolean lt(TrueAirspeed theMeasure)
This method provides a test for less than. It overrides the method in the superclass and checks for like AMeasures as well as doing the cast for you.

Returns:
Returns whether this value is less than the given value.

gt

public boolean gt(TrueAirspeed theMeasure)
This method provides a test for greater than. It overrides the method in the superclass and checks for like AMeasures as well as doing the cast for you.

Returns:
Returns whether this value is greater than the given value.

gt

public boolean gt(GenericSpeed otherSpd,
                  LocalAtm atm)
Convenience method for "greater than" test against other GenericSpeeds.

Specified by:
gt in interface GenericSpeed
Returns:
Returns whether this value is greater than the given value when at the specified atmosphere.

le

public boolean le(TrueAirspeed theMeasure)
This method provides a test for less than / equal to. It overrides the method in the superclass and checks for like AMeasures as well as doing the cast for you.

Returns:
Returns result of test for less than or equal to.

ge

public boolean ge(TrueAirspeed theMeasure)
This method provides a test for greater than / equal to. It overrides the method in the superclass and checks for like AMeasures as well as doing the cast for you.

Returns:
Returns result of test for greater than or equal to.

debug

public java.lang.String debug()
Formats value as an easy-to-read text string that shows the value in knots followed by the the unit specification. (Points out override: of AMeasure.debug() which uses the created unit.)

Specified by:
debug in interface GenericSpeed
Overrides:
debug in class AMeasure
Returns:
An easy-to-read String representing the measure in knots.

toText

public java.lang.String toText()
Prints the speed in a standardized text value format for GenericSpeeds. TAS in knots: 9kTAS

Specified by:
toText in interface GenericSpeed
Returns:
A short standardized text output value.

toString

public java.lang.String toString()
Returns the String representation of this object in its original form.

Overrides:
toString in class Speed
Returns:
A String representing the measure in the canonical unit.
See Also:
Units

asMach

public Mach asMach(LocalAtm atm)
These methods are used to return the speed as other GenericSpeeds. Note that the LocalAtm must be at the altitude to be converted.

Specified by:
asMach in interface GenericSpeed

asTrueAirspeed

public TrueAirspeed asTrueAirspeed(LocalAtm atm)
These methods are used to return the speed as other GenericSpeeds. Note that the LocalAtm must be at the altitude to be converted.

Specified by:
asTrueAirspeed in interface GenericSpeed

asIndicatedAirspeed

public IndicatedAirspeed asIndicatedAirspeed(LocalAtm atm)
These methods are used to return the speed as other GenericSpeeds. Note that the LocalAtm must be at the altitude to be converted.

Specified by:
asIndicatedAirspeed in interface GenericSpeed