public class UnitDimension extends Object implements javax.measure.Dimension, Serializable
This class represents a dimension of a unit of measurement.
The dimension associated to any given quantity are given by the published
Dimension instances. For convenience, a static method
UnitDimension.of(Class) aggregating the results of all
Dimension instances is provided.
Dimension speedDimension
= UnitDimension.of(Speed.class);
| Modifier and Type | Field and Description |
|---|---|
static javax.measure.Dimension |
AMOUNT_OF_SUBSTANCE
Holds amount of substance dimension (N).
|
static javax.measure.Dimension |
ELECTRIC_CURRENT
Holds electric current dimension (I).
|
static javax.measure.Dimension |
LENGTH
Holds length dimension (L).
|
static javax.measure.Dimension |
LUMINOUS_INTENSITY
Holds luminous intensity dimension (J).
|
static javax.measure.Dimension |
MASS
Holds mass dimension (M).
|
static javax.measure.Dimension |
NONE
Holds dimensionless.
|
static javax.measure.Dimension |
TEMPERATURE
Holds temperature dimension (Θ).
|
static javax.measure.Dimension |
TIME
Holds time dimension (T).
|
| Modifier | Constructor and Description |
|---|---|
protected |
UnitDimension()
Default Constructor (not visible).
|
| Modifier and Type | Method and Description |
|---|---|
javax.measure.Dimension |
divide(javax.measure.Dimension that)
Returns the quotient of this dimension with the one specified.
|
boolean |
equals(Object obj) |
Map<? extends javax.measure.Dimension,Integer> |
getBaseDimensions()
Returns the fundamental (base) dimensions and their exponent whose product is
this dimension or
null if this dimension is a fundamental
dimension. |
int |
hashCode() |
javax.measure.Dimension |
multiply(javax.measure.Dimension that)
Returns the product of this dimension with the one specified.
|
static <Q extends javax.measure.Quantity<Q>> |
of(Class<Q> quantityType)
Returns the dimension for the specified quantity type by aggregating the
results of
DimensionService or null if the specified
quantity is unknown. |
static javax.measure.Dimension |
parse(char symbol)
Returns the dimension for the specified symbol.
|
UnitDimension |
pow(int n)
Returns this dimension raised to an exponent.
|
UnitDimension |
root(int n)
Returns the given root of this dimension.
|
String |
toString() |
public static final javax.measure.Dimension NONE
public static final javax.measure.Dimension LENGTH
public static final javax.measure.Dimension MASS
public static final javax.measure.Dimension TIME
public static final javax.measure.Dimension ELECTRIC_CURRENT
public static final javax.measure.Dimension TEMPERATURE
public static final javax.measure.Dimension AMOUNT_OF_SUBSTANCE
public static final javax.measure.Dimension LUMINOUS_INTENSITY
protected UnitDimension()
public static <Q extends javax.measure.Quantity<Q>> javax.measure.Dimension of(Class<Q> quantityType)
DimensionService or null if the specified
quantity is unknown.quantityType - the quantity type.null.public static javax.measure.Dimension parse(char symbol)
sambol - the quantity symbol.public javax.measure.Dimension multiply(javax.measure.Dimension that)
that.multiply(this) is returned.multiply in interface javax.measure.Dimensionthat - the dimension multiplicand.this * thatpublic javax.measure.Dimension divide(javax.measure.Dimension that)
divide in interface javax.measure.Dimensionthat - the dimension divisor.this.multiply(that.pow(-1))public UnitDimension pow(int n)
pow in interface javax.measure.Dimensionn - the exponent.public UnitDimension root(int n)
root in interface javax.measure.Dimensionn - the root's order.ArithmeticException - if n == 0.public Map<? extends javax.measure.Dimension,Integer> getBaseDimensions()
null if this dimension is a fundamental
dimension.getBaseDimensions in interface javax.measure.DimensionCopyright © 2005–2021 Units of Measurement project. All rights reserved.