All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class units.Measurement

java.lang.Object
   |
   +----units.Measurement

public class Measurement
extends Object
implements Cloneable, Serializable
This class implements any quantity as the pair <µ, u>. It provides the full set of operators including addition and subtration of equally dimensioned quantities. It also has a method convert(Unit u_prime) to convert a measurement value µ to µ' for another commensurable unit u'.

Version:
$Id: Measurement.java,v 1.2 1998/07/28 22:36:58 schadow Exp $
Author:
Gunther Schadow

Constructor Index

 o Measurement()
 o Measurement(double)
 o Measurement(double, String)
 o Measurement(double, Unit)

Method Index

 o add(Measurement)
Adds to this measurement m1 another measurement m2.
 o assign(Measurement)
Sets this measurement to be equal to another measurement m.
 o clone()
 o dim()
Returns the dimension of this measurement
 o div(Measurement)
Divides this measurement m1 with another measurement m2
 o equals(Measurement)
Tests for equality of this measurement m1 and another measurement m2.
 o inv()
Invert this measurement with respect to multiplication.
 o minus()
Invert this measurement m with respect to addition.
 o mul(double)
Multiplies this measurement m with a scalar s.
 o mul(Measurement)
Multiplies this measurement m1 with another measurement m2
 o pow(int)
Raises this measurement m to a power p.
 o sub(Measurement)
Subtracts from this measurement m1 another measurement m2.

Constructors

 o Measurement
 public Measurement(double _mu,
                    Unit _u)
 o Measurement
 public Measurement(double _mu,
                    String _u)
 o Measurement
 public Measurement(double _mu)
 o Measurement
 public Measurement()

Methods

 o add
 public Measurement add(Measurement m2)
Adds to this measurement m1 another measurement m2.

Returns:
the sum m1 + m2.
 o sub
 public Measurement sub(Measurement m2)
Subtracts from this measurement m1 another measurement m2.

Returns:
the difference m1 - m2.
 o minus
 public Measurement minus()
Invert this measurement m with respect to addition.

Returns:
-m.
 o mul
 public Measurement mul(double s)
Multiplies this measurement m with a scalar s.

Returns:
the product m * s.
 o mul
 public Measurement mul(Measurement m2)
Multiplies this measurement m1 with another measurement m2

Returns:
the product m1 * m2
 o div
 public Measurement div(Measurement m2)
Divides this measurement m1 with another measurement m2

Returns:
the quotient m1 / m2
 o inv
 public Measurement inv()
Invert this measurement with respect to multiplication.

Returns:
1/u.
 o pow
 public Measurement pow(int p)
Raises this measurement m to a power p.

Returns:
the power u^p.
 o equals
 public boolean equals(Measurement m2)
Tests for equality of this measurement m1 and another measurement m2.

Returns:
true if m1 and m2 are equal, false otherwise.
 o assign
 public Measurement assign(Measurement m)
Sets this measurement to be equal to another measurement m.

Returns:
this measurement after assignment to m
 o clone
 public Object clone()
Overrides:
clone in class Object
 o dim
 public Dimension dim()
Returns the dimension of this measurement


All Packages  Class Hierarchy  This Package  Previous  Next  Index