Class QuantityDimension
java.lang.Object
tech.units.indriya.quantity.QuantityDimension
- All Implemented Interfaces:
Serializable, javax.measure.Dimension
public final class QuantityDimension
extends Object
implements javax.measure.Dimension, Serializable
This class represents a quantity dimension (dimension of a physical quantity).
The dimension associated to any given quantity are given by the published
instances. For convenience, a static method
invalid reference
DimensionServiceaggregating the results of all
@link DimensionService instances is provided.
QuantityDimension speedDimension
= QuantityDimension.of(Speed.class);
- Since:
- 1.0
- Version:
- 1.1, $Date: 2018-04-22 $
- Author:
- Jean-Marie Dautelle, Werner Keil
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final javax.measure.DimensionHolds amount of substance dimension (N).static final javax.measure.DimensionHolds electric current dimension (I).static final javax.measure.DimensionHolds length dimension (L).static final javax.measure.DimensionHolds luminous intensity dimension (J).static final javax.measure.DimensionHolds mass dimension (M).static final javax.measure.DimensionHolds dimensionless.static final javax.measure.DimensionHolds temperature dimension (Θ).static final javax.measure.DimensionHolds time dimension (T). -
Method Summary
Modifier and TypeMethodDescriptionjavax.measure.Dimensiondivide(javax.measure.Dimension that) Returns the quotient of this dimension with the one specified.divide(QuantityDimension that) Returns the quotient of this dimension with the one specified.booleanReturns the fundamental (base) dimensions and their exponent whose product is this dimension ornullif this dimension is a fundamental dimension.inthashCode()javax.measure.Dimensionmultiply(javax.measure.Dimension that) Returns the product of this dimension with the one specified.multiply(QuantityDimension that) Returns the product of this dimension with the one specified.static <Q extends javax.measure.Quantity<Q>>
javax.measure.DimensionReturns the dimension for the specified quantity type by aggregating the results oforinvalid reference
DimensionServicenullif the specified quantity is unknown.static javax.measure.Dimensionparse(char symbol) Returns the dimension for the specified symbol.final QuantityDimensionpow(int n) Returns this dimension raised to an exponent.final QuantityDimensionroot(int n) Returns the given root of this dimension.toString()
-
Field Details
-
NONE
-
LENGTH
-
MASS
-
TIME
-
ELECTRIC_CURRENT
Holds electric current dimension (I).- Since:
- 1.0
-
TEMPERATURE
-
AMOUNT_OF_SUBSTANCE
Holds amount of substance dimension (N).- Since:
- 1.0
-
LUMINOUS_INTENSITY
Holds luminous intensity dimension (J).
-
-
Method Details
-
of
public static <Q extends javax.measure.Quantity<Q>> javax.measure.Dimension of(Class<Q> quantityType) Returns the dimension for the specified quantity type by aggregating the results oforinvalid reference
DimensionServicenullif the specified quantity is unknown.- Parameters:
quantityType- the quantity type.- Returns:
- the dimension for the quantity type or
null. - Since:
- 1.1
-
parse
Returns the dimension for the specified symbol.- Parameters:
sambol- the quantity symbol.- Returns:
- the dimension for the given symbol.
- Since:
- 1.0.1
-
multiply
Returns the product of this dimension with the one specified. If the specified dimension is not a physics dimension, thenthat.multiply(this)is returned.- Specified by:
multiplyin interfacejavax.measure.Dimension- Parameters:
that- the dimension multiplicand.- Returns:
this * that- Since:
- 1.0
-
multiply
Returns the product of this dimension with the one specified.- Parameters:
that- the dimension multiplicand.- Returns:
this * that- Since:
- 1.0
-
divide
Returns the quotient of this dimension with the one specified.- Specified by:
dividein interfacejavax.measure.Dimension- Parameters:
that- the dimension divisor.- Returns:
this.multiply(that.pow(-1))- Since:
- 1.0
-
divide
Returns the quotient of this dimension with the one specified.- Parameters:
that- the dimension divisor.- Returns:
this.multiply(that.pow(-1))- Since:
- 1.0
-
pow
Returns this dimension raised to an exponent.- Specified by:
powin interfacejavax.measure.Dimension- Parameters:
n- the exponent.- Returns:
- the result of raising this dimension to the exponent.
- Since:
- 1.0
-
root
Returns the given root of this dimension.- Specified by:
rootin interfacejavax.measure.Dimension- Parameters:
n- the root's order.- Returns:
- the result of taking the given root of this dimension.
- Throws:
ArithmeticException- ifn == 0.- Since:
- 1.0
-
getBaseDimensions
Returns the fundamental (base) dimensions and their exponent whose product is this dimension ornullif this dimension is a fundamental dimension.- Specified by:
getBaseDimensionsin interfacejavax.measure.Dimension- Returns:
- the mapping between the base dimensions and their exponent.
- Since:
- 1.0
-
toString
-
equals
-
hashCode
-