ucar.units
Class UnitSystemImpl

java.lang.Object
  extended by ucar.units.UnitSystemImpl
All Implemented Interfaces:
Serializable, UnitSystem
Direct Known Subclasses:
SI

public class UnitSystemImpl
extends Object
implements UnitSystem, Serializable

Version:
$Id: UnitSystemImpl.java 64 2006-07-12 22:30:50Z edavis $
Author:
Steven R. Emmerson
See Also:
Serialized Form

Constructor Summary
protected UnitSystemImpl(UnitDBImpl baseUnitDB, UnitDBImpl derivedUnitDB)
          Constructs from a base unit database and a derived unit database.
 
Method Summary
 BaseUnit getBaseUnit(BaseQuantity quantity)
          Returns the base unit corresponding to a base quantity.
 UnitDB getBaseUnitDB()
          Returns the base unit database.
 UnitDB getUnitDB()
          Returns the complete unit database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnitSystemImpl

protected UnitSystemImpl(UnitDBImpl baseUnitDB,
                         UnitDBImpl derivedUnitDB)
                  throws UnitExistsException
Constructs from a base unit database and a derived unit database.

Parameters:
baseUnitDB - The base unit database. Shall only contain base units.
derivedUnitDB - The derived unit database. Shall not contain any base units.
Throws:
UnitExistsException - A unit with the same identifier exists in both databases.
Method Detail

getBaseUnitDB

public final UnitDB getBaseUnitDB()
Returns the base unit database.

Specified by:
getBaseUnitDB in interface UnitSystem
Returns:
The base unit database.

getUnitDB

public final UnitDB getUnitDB()
Returns the complete unit database.

Specified by:
getUnitDB in interface UnitSystem
Returns:
The complete unit database (both base units and derived units).

getBaseUnit

public final BaseUnit getBaseUnit(BaseQuantity quantity)
Returns the base unit corresponding to a base quantity.

Specified by:
getBaseUnit in interface UnitSystem
Parameters:
quantity - The base quantity.
Returns:
The base unit corresponding to the base quantity in this system of units or null if no such unit exists.


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