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 protected
UnitSystemImpl(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 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.
-
-
-
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 interfaceUnitSystem
- Returns:
- The base unit database.
-
getUnitDB
public final UnitDB getUnitDB()
Returns the complete unit database.- Specified by:
getUnitDB
in 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:
getBaseUnit
in interfaceUnitSystem
- 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.
-
-