etomica.units
Class UnitRatio

java.lang.Object
  extended by etomica.units.CompoundUnit
      extended by etomica.units.UnitRatio
All Implemented Interfaces:
Unit, Serializable

public class UnitRatio
extends CompoundUnit

Class for constructing units forms as ratios of other units. Examples include "Joules per mole", "gram per liter", and so on. Conversion factor and labels are determined from the values given by the constituent units.

See Also:
Serialized Form

Constructor Summary
UnitRatio(Unit numerator, Unit denominator)
          Constructs the compound unit using conversion factors and labels from the constituent units.
UnitRatio(Unit numerator, Unit denominator, String name, String symbol)
           
 
Method Summary
 
Methods inherited from class etomica.units.CompoundUnit
dimension, fromSim, prefixAllowed, symbol, toSim
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnitRatio

public UnitRatio(Unit numerator,
                 Unit denominator)
Constructs the compound unit using conversion factors and labels from the constituent units. These factors/labels are computed once during construction, and are not updated if the units are modified by changing their prefix value.

Parameters:
numerator - the unit in the numerator of the compound unit
denominator - the unit in the denominator of the compount unit

UnitRatio

public UnitRatio(Unit numerator,
                 Unit denominator,
                 String name,
                 String symbol)
Parameters:
numerator - the unit in the numerator of the compound unit
denominator - the unit in the denominator of the compount unit
name - a description of the unit (e.g., Joules per mole)
symbol - an abbreviated description of the unit (e.g., J/mol)