Package ucar.units

Class UnitSystemImpl

    • 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.