Interface SystemOfUnits


  • public interface SystemOfUnits
    A system of units grouped together for historical or cultural reasons.
    Common system of units are "SI" (System International), "Imperial" (British), "US" (US Customary). Nothing prevents a unit from belonging to several systems of units at the same time (for example an Imperial system would have many of the units held by the US Customary system).
    Since:
    1.0
    Version:
    1.0, August 8, 2016
    See Also:
    Wikipedia: International System of Units, Wikipedia: System of measurement
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getName()  
      <Q extends Quantity<Q>>
      Unit<Q>
      getUnit​(java.lang.Class<Q> quantityType)
      Returns the default unit for the specified quantity.
      java.util.Set<? extends Unit<?>> getUnits()
      Returns a read only view over the units explicitly defined by this system.
      java.util.Set<? extends Unit<?>> getUnits​(Dimension dimension)
      Returns the units defined in this system having the specified dimension (convenience method).
    • Method Detail

      • getName

        java.lang.String getName()
        Returns:
        a name
      • getUnit

        <Q extends Quantity<Q>> Unit<Q> getUnit​(java.lang.Class<Q> quantityType)
        Returns the default unit for the specified quantity.
        Type Parameters:
        Q - the compile-time quantity type.
        Parameters:
        quantityType - the quantity type.
        Returns:
        the unit for the specified quantity.
      • getUnits

        java.util.Set<? extends Unit<?>> getUnits()
        Returns a read only view over the units explicitly defined by this system. This include the base and derived units which are assigned a special name and symbol. This set does not include new units created by arithmetic or other operations.
        Returns:
        the defined collection of units.
      • getUnits

        java.util.Set<? extends Unit<?>> getUnits​(Dimension dimension)
        Returns the units defined in this system having the specified dimension (convenience method).
        Parameters:
        dimension - the dimension of the units to be returned.
        Returns:
        the collection of units of specified dimension.