visad
Class QuantityDimension

java.lang.Object
  extended by visad.QuantityDimension
All Implemented Interfaces:
Serializable, Comparable

public final class QuantityDimension
extends Object
implements Serializable, Comparable

This class represents the dimension of a quantity. For example, consider a nonrelativistic particle of mass m in uniform motion which travels a distance l in a time t. Its velocity is v=l/t and its kinetic energy is E=mv2/2=ml2t-2/2. The dimension of E is dim E=ML2T-2 and the dimensional exponents are 1, 2, and -2. A QuantityDimension is immutable.

See Also:
Serialized Form

Constructor Summary
QuantityDimension()
          Constructs from nothing (i.e. constructs a dimensionless quantity).
QuantityDimension(QuantityDimension that)
          Constructs from another dimension of a quantity.
QuantityDimension(Unit unit)
          Constructs from an existing Unit.
 
Method Summary
 int compareTo(Object obj)
          Compare this dimension of a quantity to another.
 QuantityDimension divide(QuantityDimension that)
          Divide this dimension of a quantity by another.
 boolean equals(Object obj)
          Indicate whether or not this dimension of a quantity is the same as another.
 boolean isDimensionless()
          Indicate whether or not this dimension of a quantity is dimensionless.
static void main(String[] args)
          Test this class.
 QuantityDimension multiply(QuantityDimension that)
          Multiply this dimension of a quantity by another.
 QuantityDimension raise(int power)
          Raise this dimension of a quantity by a power.
 String toString()
          Return a string representation of this dimension of a quantity.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuantityDimension

public QuantityDimension()
Constructs from nothing (i.e. constructs a dimensionless quantity).


QuantityDimension

public QuantityDimension(QuantityDimension that)
Constructs from another dimension of a quantity.


QuantityDimension

public QuantityDimension(Unit unit)
                  throws UnitException
Constructs from an existing Unit.

Throws:
UnitException
Method Detail

compareTo

public int compareTo(Object obj)
Compare this dimension of a quantity to another.

Specified by:
compareTo in interface Comparable

equals

public boolean equals(Object obj)
Indicate whether or not this dimension of a quantity is the same as another.

Overrides:
equals in class Object

raise

public QuantityDimension raise(int power)
Raise this dimension of a quantity by a power.


multiply

public QuantityDimension multiply(QuantityDimension that)
Multiply this dimension of a quantity by another.


divide

public QuantityDimension divide(QuantityDimension that)
Divide this dimension of a quantity by another.


isDimensionless

public boolean isDimensionless()
Indicate whether or not this dimension of a quantity is dimensionless.


toString

public String toString()
Return a string representation of this dimension of a quantity.

Overrides:
toString in class Object

main

public static void main(String[] args)
Test this class.