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
DimensionService
instances. For convenience, a static method
{@link QuantityDimension#of(Class) aggregating the results of all
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 and Type | Method and Description |
---|---|
javax.measure.Dimension |
divide(javax.measure.Dimension that)
Returns the quotient of this dimension with the one specified.
|
QuantityDimension |
divide(QuantityDimension 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. |
static <Q extends javax.measure.Quantity<Q>> |
getInstance(Class<Q> quantityType)
Deprecated.
use of()
|
int |
hashCode() |
javax.measure.Dimension |
multiply(javax.measure.Dimension that)
Returns the product of this dimension with the one specified.
|
QuantityDimension |
multiply(QuantityDimension 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.
|
QuantityDimension |
pow(int n)
Returns this dimension raised to an exponent.
|
QuantityDimension |
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
public static <Q extends javax.measure.Quantity<Q>> javax.measure.Dimension getInstance(Class<Q> quantityType)
DimensionService
or null
if the
specified quantity is unknown.quantityType
- the quantity type.null
.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.Dimension
that
- the dimension multiplicand.this * that
public QuantityDimension multiply(QuantityDimension that)
that
- the dimension multiplicand.this * that
public javax.measure.Dimension divide(javax.measure.Dimension that)
divide
in interface javax.measure.Dimension
that
- the dimension divisor.this.multiply(that.pow(-1))
public QuantityDimension divide(QuantityDimension that)
that
- the dimension divisor.this.multiply(that.pow(-1))
public final QuantityDimension pow(int n)
pow
in interface javax.measure.Dimension
n
- the exponent.public final QuantityDimension root(int n)
root
in interface javax.measure.Dimension
n
- 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.Dimension
Copyright © 2005–2017 Units of Measurement project. All rights reserved.