Package ucar.units
Class QuantityDimension
- java.lang.Object
-
- ucar.units.Dimension
-
- ucar.units.QuantityDimension
-
@Immutable public final class QuantityDimension extends Dimension
Provides support for the dimension of a quantity. For example, the dimension of the quantity "force" is "M.L.t-2".
-
-
Constructor Summary
Constructors Modifier Constructor Description QuantityDimension()
Constructs from nothing.QuantityDimension(BaseQuantity baseQuantity)
Constructs from a base quantity.protected
QuantityDimension(Factor[] factors)
Constructs from an array of Factor-s.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QuantityDimension
divideBy(QuantityDimension that)
Divides this quantity dimension by another quantity dimension.QuantityDimension
multiplyBy(QuantityDimension that)
Multiplies this quantity dimension by another quantity dimension.QuantityDimension
raiseTo(int power)
Raises this quantity dimension to a power.-
Methods inherited from class ucar.units.Dimension
equals, getFactors, getRank, hashCode, isDimensionless, isReciprocalOf, mult, pow, toString
-
-
-
-
Constructor Detail
-
QuantityDimension
public QuantityDimension()
Constructs from nothing. Constructs a dimensionless dimension.
-
QuantityDimension
public QuantityDimension(BaseQuantity baseQuantity)
Constructs from a base quantity.- Parameters:
baseQuantity
- The base quantity constituting the dimension.
-
QuantityDimension
protected QuantityDimension(Factor[] factors)
Constructs from an array of Factor-s. This is a trusted constructor for use by subclasses only.- Parameters:
factors
- The Factor-s constituting the dimension.
-
-
Method Detail
-
multiplyBy
public QuantityDimension multiplyBy(QuantityDimension that)
Multiplies this quantity dimension by another quantity dimension.- Parameters:
that
- The other quantity dimension.- Returns:
- The product of this quantity dimension with the other quantity dimension.
-
divideBy
public QuantityDimension divideBy(QuantityDimension that)
Divides this quantity dimension by another quantity dimension.- Parameters:
that
- The quantity dimension to divide this quantity dimension by.- Returns:
- The quotient of this quantity dimension and the other quantity dimension.
-
raiseTo
public QuantityDimension raiseTo(int power)
Raises this quantity dimension to a power.- Parameters:
power
- The power to raise this quantity dimension by.- Returns:
- The result of raising this quantity dimension
to the power
power
.
-
-