Interface UnitProvider


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

    Modifier and Type
    Method
    Description
    Collection<Class<? extends javax.measure.Quantity<?>>>
     
    javax.measure.spi.SystemOfUnits
    Returns the SystemOfUnits which is currently set, must not be null.
    <T extends javax.measure.Quantity<T>>
    javax.measure.Unit<T>
    getUnit(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>> javax.measure.Unit<T> getUnit(Class<T> dimension) throws IllegalArgumentException
      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
      Throws:
      IllegalArgumentException - when the dimension is unknown
    • 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.
    • getAllDimensions

      Collection<Class<? extends javax.measure.Quantity<?>>> getAllDimensions()