faa.tg.units
Class AltitudeRate

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

public class AltitudeRate
extends Speed

 The AltitudeRate class defines the objects used to quantify the rate of
 altitude change.
 
See section 5.6 of the Detailed Design Document for a discussion of design issues.

See the source: AltitudeRate.java

Version:
$Id: AltitudeRate.java,v 3.3 2008/08/07 19:59:03 lykensj Exp $
Author:
Tim Kimmet (modeled after Robert G. Oliver's Units Classes)
See Also:
AUnits, AMeasure, Units.mPerSec, Serialized Form

Field Summary
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
(package private) static long serialVersionUID
           
static AltitudeRate ZERO
           
 
Fields inherited from class faa.tg.units.Speed
ACCEPTABLE_VARIATION, KTS_1, KTS_10, KTS_20, 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
AltitudeRate(Altitude startAlt, Altitude endAlt, Time timeToChg)
          Creates an AltitudeRate based on the difference between two altitudes over a period of time.
AltitudeRate(Altitude altChg, Time timeToChg)
          Constructor that takes an altitude change and the period of time to change by that altitude amount.
AltitudeRate(double theValue, SpeedUnits theUnits)
          Constructor for the AltitudeRate class.
 
Method Summary
 AltitudeRate add(AltitudeRate theMeasure)
          This summation method adds a value with like units.
 double as(SpeedUnits theUnits)
          The as method extracts the value from a Measure in specified units.
 boolean eq(AltitudeRate theMeasure)
          This method provides a test for equality.
 boolean ge(AltitudeRate theMeasure)
          This method provides a test for less than / equal to.
 boolean gt(AltitudeRate theMeasure)
          This method provides a test for greater than.
 boolean le(AltitudeRate theMeasure)
          This method provides a test for greater than / equal to.
 boolean lt(AltitudeRate theMeasure)
          This method provides a test for less than.
 double ratio(AltitudeRate val)
          This division method produces a dimensionless ratio of like measures.
 AltitudeRate sub(AltitudeRate theMeasure)
          This subtraction method subtracts a value with like units.
 java.lang.String toString()
          Returns the String representation of this object in the form it was created.
 
Methods inherited from class faa.tg.units.Speed
abs, add, aeq, 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, 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

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 AltitudeRate ZERO
Constructor Detail

AltitudeRate

public AltitudeRate(double theValue,
                    SpeedUnits theUnits)
Constructor for the AltitudeRate class.

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

AltitudeRate

public AltitudeRate(Altitude startAlt,
                    Altitude endAlt,
                    Time timeToChg)
             throws java.lang.ArithmeticException
Creates an AltitudeRate based on the difference between two altitudes over a period of time.

Parameters:
startAlt - the initial altitude.
endAlt - the altitude changed to.
timeToChg - the time it took to change altitudes.
Throws:
java.lang.ArithmeticException - if time is zero.

AltitudeRate

public AltitudeRate(Altitude altChg,
                    Time timeToChg)
Constructor that takes an altitude change and the period of time to change by that altitude amount.

Parameters:
altChg - the change in altitude during the time specified.
timeToChg - the time it took to change by the specified altitude.
Throws:
java.lang.ArithmeticException - if time is zero.
Method Detail

add

public AltitudeRate add(AltitudeRate 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 unit of measure you wish to add to this measure.
Returns:
A new AltitudeRate with the sum of the values.

sub

public AltitudeRate sub(AltitudeRate 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 unit of measure you wish to sub from this measure.
Returns:
A new AltitudeRate with the difference of the values.

ratio

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

Returns:
the ratio of the two measures

eq

public boolean eq(AltitudeRate 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(AltitudeRate 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(AltitudeRate 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.

ge

public boolean ge(AltitudeRate 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.

le

public boolean le(AltitudeRate 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.

as

public double as(SpeedUnits theUnits)
The as method extracts the value from a Measure in specified units. Override for type safety!

Overrides:
as in class Speed
Parameters:
theUnits - the units of the value that will be returned (ex: km)
Returns:
the value of the measure in specified units

toString

public java.lang.String toString()
Returns the String representation of this object in the form it was created.

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