net.agmodel.physical
Class Acceleration

java.lang.Object
  |
  +--net.agmodel.physical.AbstractQuantity
        |
        +--net.agmodel.physical.Acceleration
All Implemented Interfaces:
Cloneable, Comparable, Serializable

public final class Acceleration
extends AbstractQuantity
implements Comparable

This class represents the rate of change of speed with respect to time.

See Also:
Speed, Duration, Serialized Form

Field Summary
protected static double[] factors
          Conversion table.
static int METERS_PER_SQUARE_SECOND
          Used to specify meter per square second unit.
static int METRES_PER_SQUARE_SECOND
           
 
Fields inherited from class net.agmodel.physical.AbstractQuantity
AMOUNT_OF_SUBSTANCE, COMPLETE, derivation, DEVOID, DIMENSIONLESS, ELECTRIC_CURRENT, LENGTH, LUMINOUS_INTENSITY, MASS, SPATIALLYINTERPOLATED, TEMPORALLYINTERPOLATED, THERMODYNAMIC_TEMPERATURE, TIME, UNINTERPOLATED
 
Constructor Summary
Acceleration(Composite c)
          Acceleration constructor from Composite quantity.
Acceleration(double value, int unit)
          Acceleration constructor.
 
Method Summary
 Acceleration add(Acceleration x)
          Returns an Acceleration whose value is (this + x).
 int compareTo(Acceleration x)
          Compares this Acceleration with the specified Acceleration.
 int compareTo(Object o)
          Compares this Acceleration with the specified Object.
 Acceleration divide(double coefficient)
          Returns an Acceleration whose value is (this / coefficient).
protected  int getDimensionSI()
          Gets the SI dimension of this Acceleration.
 double getValue(int unit)
          Gets the acceleration in the specified unit.
protected  double getValueSI()
          Gets the acceleration in SI units.
 Acceleration multiply(double coefficient)
          Returns an Acceleration whose value is (this * coefficient).
 Speed multiply(Duration d)
          Returns a Speed whose value is (this * d).
 void setValue(double value, int unit)
          Sets this Acceleration using the specified unit.
 Acceleration substract(Acceleration x)
          Returns an Acceleration whose value is (this - x).
 
Methods inherited from class net.agmodel.physical.AbstractQuantity
clone, divide, getSymbolSI, isSpatiallyInterpolated, isTemporallyInterpolated, multiply, toComposite, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

METERS_PER_SQUARE_SECOND

public static final int METERS_PER_SQUARE_SECOND
Used to specify meter per square second unit.

See Also:
Constant Field Values

METRES_PER_SQUARE_SECOND

public static final int METRES_PER_SQUARE_SECOND
See Also:
Constant Field Values

factors

protected static final double[] factors
Conversion table. For each unit, it specifies the equivalent value using SI units.

Constructor Detail

Acceleration

public Acceleration(double value,
                    int unit)
Acceleration constructor.

Parameters:
value - the acceleration in the specified unit.
unit - the measurement unit being used.
Throws:
ArrayIndexOutOfBoundsException - unknown measurement unit

Acceleration

public Acceleration(Composite c)
Acceleration constructor from Composite quantity.

Parameters:
c - the quantity to convert.
Throws:
UnitDimensionException - composite is not an acceleration.
See Also:
Composite
Method Detail

getValue

public double getValue(int unit)
Gets the acceleration in the specified unit.

Parameters:
unit - the measurement unit being used.
Returns:
acceleration in the specified measurement unit.
Throws:
ArrayIndexOutOfBoundsException - unknown measurement unit

setValue

public void setValue(double value,
                     int unit)
Sets this Acceleration using the specified unit.

Parameters:
value - the new acceleration in the specified unit.
unit - the measurement unit being used.
Throws:
ArrayIndexOutOfBoundsException - unknown measurement unit

add

public Acceleration add(Acceleration x)
Returns an Acceleration whose value is (this + x).

Parameters:
x - the Acceleration to be added.
Returns:
(this + x)

substract

public Acceleration substract(Acceleration x)
Returns an Acceleration whose value is (this - x).

Parameters:
x - the Acceleration to be substracted.
Returns:
(this - x)

multiply

public Acceleration multiply(double coefficient)
Returns an Acceleration whose value is (this * coefficient).

Parameters:
coefficient - the dimensionless multiplier.
Returns:
(this * coefficient)

divide

public Acceleration divide(double coefficient)
Returns an Acceleration whose value is (this / coefficient).

Parameters:
coefficient - the dimensionless divisor.
Returns:
(this / coefficient)
Throws:
ArithmeticException - coefficient == 0.0

multiply

public Speed multiply(Duration d)
Returns a Speed whose value is (this * d).

Parameters:
d - the duration multiplier.
Returns:
(this * d)

compareTo

public int compareTo(Acceleration x)
Compares this Acceleration with the specified Acceleration. This method is provided in preference to individual methods for each of the six boolean comparison operators (<, ==, >, >=, !=, <=). The suggested idiom for performing these comparisons is: (x.compareTo(y) <op> 0), where <op> is one of the six comparison operators.

Parameters:
x - Acceleration to which this Acceleration is to be compared.
Returns:
-1, 0 or 1 as this Acceleration is numerically less than, equal to, or greater than x.

compareTo

public int compareTo(Object o)
Compares this Acceleration with the specified Object. If the Object is a Acceleration, this method behaves like compareTo(Acceleration). Otherwise, it throws a ClassCastException (as Accelerations are comparable only to other Accelerations).

Specified by:
compareTo in interface Comparable
Parameters:
o - Object to which this Acceleration is to be compared.
Returns:
a negative number, zero, or a positive number as this Acceleration is numerically less than, equal to, or greater than o, which must be a Acceleration.
Throws:
ClassCastException - o is not a Acceleration.
See Also:
compareTo(Acceleration), Comparable

getValueSI

protected double getValueSI()
Gets the acceleration in SI units.

Specified by:
getValueSI in class AbstractQuantity
Returns:
acceleration in SI units.

getDimensionSI

protected int getDimensionSI()
Gets the SI dimension of this Acceleration.

Specified by:
getDimensionSI in class AbstractQuantity
Returns:
LENGTH - 2 * TIME