public class UnitSystemImpl extends java.lang.Object implements UnitSystem, java.io.Serializable
Modifier | Constructor and Description |
---|---|
protected |
UnitSystemImpl(UnitDBImpl baseUnitDB,
UnitDBImpl derivedUnitDB)
Constructs from a base unit database and a derived unit database.
|
Modifier and Type | Method and 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.
|
protected UnitSystemImpl(UnitDBImpl baseUnitDB, UnitDBImpl derivedUnitDB) throws UnitExistsException
baseUnitDB
- The base unit database. Shall only contain base units.derivedUnitDB
- The derived unit database. Shall not contain any base units.UnitExistsException
- A unit with the same identifier exists in both databases.public final UnitDB getBaseUnitDB()
getBaseUnitDB
in interface UnitSystem
public final UnitDB getUnitDB()
getUnitDB
in interface UnitSystem
public final BaseUnit getBaseUnit(BaseQuantity quantity)
getBaseUnit
in interface UnitSystem
quantity
- The base quantity.
null
if no such unit exists.