Package ucar.units
Class UnitSystemImpl
- java.lang.Object
-
- ucar.units.UnitSystemImpl
-
- All Implemented Interfaces:
Serializable,UnitSystem
- Direct Known Subclasses:
SI
public class UnitSystemImpl extends Object implements UnitSystem, Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUnitSystemImpl(UnitDBImpl baseUnitDB, UnitDBImpl derivedUnitDB)Constructs from a base unit database and a derived unit database.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BaseUnitgetBaseUnit(BaseQuantity quantity)Returns the base unit corresponding to a base quantity.UnitDBgetBaseUnitDB()Returns the base unit database.UnitDBgetUnitDB()Returns the complete unit database.
-
-
-
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:
getBaseUnitDBin interfaceUnitSystem- Returns:
- The base unit database.
-
getUnitDB
public final UnitDB getUnitDB()
Returns the complete unit database.- Specified by:
getUnitDBin interfaceUnitSystem- 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:
getBaseUnitin interfaceUnitSystem- Parameters:
quantity- The base quantity.- Returns:
- The base unit corresponding to the base quantity in this system
of units or
nullif no such unit exists.
-
-