Class BaseUnit<Q extends javax.measure.Quantity<Q>>

  • All Implemented Interfaces:
    Serializable, Comparable<javax.measure.Unit<Q>>, javax.measure.Unit<Q>, ComparableUnit<Q>, tech.uom.lib.common.function.Nameable, tech.uom.lib.common.function.PrefixOperator<Q>, tech.uom.lib.common.function.SymbolSupplier

    public final class BaseUnit<Q extends javax.measure.Quantity<Q>>
    extends AbstractUnit<Q>

    This class represents the building blocks on top of which all others physical units are created. Base units are always unscaled SI units.

    When using the standard model, all seven SI base units are dimensionally independent.

    Since:
    1.0
    Version:
    2.0, February 7, 2020
    Author:
    Jean-Marie Dautelle, Werner Keil
    See Also:
    Wikipedia: SI base unit, Serialized Form
    • Constructor Detail

      • BaseUnit

        public BaseUnit​(String symbol,
                        javax.measure.Dimension dimension)
        Creates a base unit having the specified symbol and dimension.
        Parameters:
        symbol - the symbol of this base unit.
      • BaseUnit

        public BaseUnit​(String symbol)
        Creates a base unit having the specified symbol.
        Parameters:
        symbol - the symbol of this base unit.
      • BaseUnit

        public BaseUnit​(String symbol,
                        String name)
        Creates a base unit having the specified symbol and name.
        Parameters:
        symbol - the symbol of this base unit.
        name - the name of this base unit.
        Throws:
        IllegalArgumentException - if the specified symbol is associated to a different unit.
      • BaseUnit

        public BaseUnit​(String symbol,
                        String name,
                        javax.measure.Dimension dimension)
        Creates a base unit having the specified symbol, name and dimension.
        Parameters:
        symbol - the symbol of this base unit.
        name - the name of this base unit.
        Throws:
        IllegalArgumentException - if the specified symbol is associated to a different unit.
        Since:
        2.0
    • Method Detail

      • toSystemUnit

        public javax.measure.Unit<Q> toSystemUnit()
        Description copied from class: AbstractUnit
        Returns the unscaled SI unit from which this unit is derived. The SI unit can be be used to identify a quantity given the unit. For example: static boolean isAngularVelocity(AbstractUnit unit) { return unit.toSystemUnit().equals(RADIAN.divide(SECOND)); } assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true.
        Specified by:
        toSystemUnit in class AbstractUnit<Q extends javax.measure.Quantity<Q>>
        Returns:
        the unscaled metric unit from which this unit is derived.
      • getDimension

        public javax.measure.Dimension getDimension()
        Specified by:
        getDimension in interface javax.measure.Unit<Q extends javax.measure.Quantity<Q>>
        Specified by:
        getDimension in class AbstractUnit<Q extends javax.measure.Quantity<Q>>