Interface UnitProvider


@NonNullByDefault public interface UnitProvider
Provides Units and the current SystemOfUnits.
Author:
Henning Treu - Initial contribution
  • Method Summary

    Modifier and Type
    Method
    Description
    javax.measure.spi.SystemOfUnits
    Returns the SystemOfUnits which is currently set, must not be null.
    <T extends javax.measure.Quantity<T>>
    @Nullable javax.measure.Unit<T>
    getUnit(@Nullable Class<T> dimension)
    Retrieves the default Unit for the given Quantity according to the current SystemOfUnits.
  • Method Details

    • getUnit

      <T extends javax.measure.Quantity<T>> @Nullable javax.measure.Unit<T> getUnit(@Nullable Class<T> dimension)
      Retrieves the default Unit for the given Quantity according to the current SystemOfUnits.
      Parameters:
      dimension - The Quantity, called dimension here, defines the base unit for the retrieved unit. E.g. call getUnit(javax.measure.quantity.Temperature.class) to retrieve the temperature unit according to the current SystemOfUnits.
      Returns:
      The Unit matching the given Quantity, null otherwise.
    • getMeasurementSystem

      javax.measure.spi.SystemOfUnits getMeasurementSystem()
      Returns the SystemOfUnits which is currently set, must not be null.
      Returns:
      the SystemOfUnits which is currently set, must not be null.