public final class QuantityDimension
extends java.lang.Object
implements javax.measure.Dimension, java.io.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).
|
private static java.util.logging.Logger |
logger |
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.
|
private javax.measure.Unit<?> |
pseudoUnit
Holds the pseudo unit associated to this dimension.
|
private static long |
serialVersionUID |
static javax.measure.Dimension |
TEMPERATURE
Holds temperature dimension (Θ).
|
static javax.measure.Dimension |
TIME
Holds time dimension (T).
|
Modifier | Constructor and Description |
---|---|
(package private) |
QuantityDimension(char symbol)
Returns the physical dimension having the specified symbol.
|
private |
QuantityDimension(javax.measure.Unit<?> pseudoUnit)
Constructor from pseudo-unit (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.
|
QuantityDimension |
divide(QuantityDimension that)
Returns the quotient of this dimension with the one specified.
|
boolean |
equals(java.lang.Object obj) |
java.util.Map<? extends javax.measure.Dimension,java.lang.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(java.lang.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(java.lang.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.
|
java.lang.String |
toString() |
private static final java.util.logging.Logger logger
private static final long serialVersionUID
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
private final javax.measure.Unit<?> pseudoUnit
QuantityDimension(char symbol)
symbol
- the associated symbol.private QuantityDimension(javax.measure.Unit<?> pseudoUnit)
pseudoUnit
- the pseudo-unit.public static <Q extends javax.measure.Quantity<Q>> javax.measure.Dimension getInstance(java.lang.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(java.lang.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.java.lang.ArithmeticException
- if n == 0
.public java.util.Map<? extends javax.measure.Dimension,java.lang.Integer> getBaseDimensions()
null
if this dimension is a
fundamental dimension.getBaseDimensions
in interface javax.measure.Dimension
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object