Package javax.measure

Interface Dimension


public interface Dimension
Represents the dimension of a unit.

Concrete dimensions are obtained through the Unit.getDimension() method.

Two units u1 and u2 are compatible if and only if u1.getDimension().equals(u2.getDimension()).

Since:
1.0
Version:
1.0, August 8, 2016
Author:
Jean-Marie Dautelle, Werner Keil
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    divide(Dimension divisor)
    Returns the quotient of this dimension with the one specified.
    Map<? extends Dimension,Integer>
    Returns the (fundamental) base dimensions and their exponent whose product is this dimension, or null if this dimension is a base dimension.
    multiply(Dimension multiplicand)
    Returns the product of this dimension with the one specified.
    pow(int n)
    Returns this dimension raised to an exponent.
    root(int n)
    Returns the given root of this dimension.
  • Method Details

    • multiply

      Dimension multiply(Dimension multiplicand)
      Returns the product of this dimension with the one specified.
      Parameters:
      multiplicand - the dimension multiplicand.
      Returns:
      this * multiplicand
    • divide

      Returns the quotient of this dimension with the one specified.
      Parameters:
      divisor - the dimension divisor.
      Returns:
      this / divisor
    • pow

      Dimension pow(int n)
      Returns this dimension raised to an exponent. (thisn)
      Parameters:
      n - power to raise this Dimension to.
      Returns:
      thisn
    • root

      Dimension root(int n)
      Returns the given root of this dimension.
      Parameters:
      n - the root's order.
      Returns:
      the result of taking the given root of this dimension.
      Throws:
      ArithmeticException - if n == 0.
    • getBaseDimensions

      Returns the (fundamental) base dimensions and their exponent whose product is this dimension, or null if this dimension is a base dimension.
      Returns:
      the mapping between the fundamental dimensions and their exponent.