ucar.units
Class QuantityDimension

java.lang.Object
  extended by ucar.units.Dimension
      extended by ucar.units.QuantityDimension

public final class QuantityDimension
extends Dimension

Provides support for the dimension of a quantity. For example, the dimension of the quantity "force" is "M.L.t-2".

Version:
$Id: QuantityDimension.java 64 2006-07-12 22:30:50Z edavis $ Immutable.
Author:
Steven R. Emmerson

Field Summary
 
Fields inherited from class ucar.units.Dimension
_factors
 
Constructor Summary
  QuantityDimension()
          Constructs from nothing.
  QuantityDimension(BaseQuantity baseQuantity)
          Constructs from a base quantity.
protected QuantityDimension(Factor[] factors)
          Constructs from an array of Factor-s.
 
Method Summary
 QuantityDimension divideBy(QuantityDimension that)
          Divides this quantity dimension by another quantity dimension.
static void main(String[] args)
          Tests this class.
 QuantityDimension multiplyBy(QuantityDimension that)
          Multiplies this quantity dimension by another quantity dimension.
 QuantityDimension raiseTo(int power)
          Raises this quantity dimension to a power.
 
Methods inherited from class ucar.units.Dimension
equals, getFactors, getRank, hashCode, isDimensionless, isReciprocalOf, mult, pow, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuantityDimension

public QuantityDimension()
Constructs from nothing. Constructs a dimensionless dimension.


QuantityDimension

public QuantityDimension(BaseQuantity baseQuantity)
Constructs from a base quantity.

Parameters:
baseQuantity - The base quantity constituting the dimension.

QuantityDimension

protected QuantityDimension(Factor[] factors)
Constructs from an array of Factor-s. This is a trusted constructor for use by subclasses only.

Parameters:
factors - The Factor-s constituting the dimension.
Method Detail

multiplyBy

public QuantityDimension multiplyBy(QuantityDimension that)
Multiplies this quantity dimension by another quantity dimension.

Parameters:
that - The other quantity dimension.
Returns:
The product of this quantity dimension with the other quantity dimension.

divideBy

public QuantityDimension divideBy(QuantityDimension that)
Divides this quantity dimension by another quantity dimension.

Parameters:
that - The quantity dimension to divide this quantity dimension by.
Returns:
The quotient of this quantity dimension and the other quantity dimension.

raiseTo

public QuantityDimension raiseTo(int power)
Raises this quantity dimension to a power.

Parameters:
power - The power to raise this quantity dimension by.
Returns:
The result of raising this quantity dimension to the power power.

main

public static void main(String[] args)
                 throws Exception
Tests this class.

Throws:
Exception


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.