|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.measure.unit.Unit<Q>
javax.measure.unit.DerivedUnit<Q>
javax.measure.unit.AlternateUnit<Q>
public final class AlternateUnit<Q extends Quantity>
This class represents the units used in expressions to distinguish between quantities of a different nature but of the same dimensions.
Instances of this class are created through the
Unit.alternate(String)
method.
Field Summary |
---|
Fields inherited from class javax.measure.unit.Unit |
---|
ONE |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object that)
Indicates if this alternate unit is considered equals to the specified object (both are alternate units with equal symbol, equal base units and equal converter to base units). |
Unit<? super Q> |
getParent()
Returns the parent unit from which this alternate unit is derived (a system unit itself). |
Unit<? super Q> |
getStandardUnit()
Returns the base unit , alternate
unit or product of base units and alternate units this unit is derived
from. |
java.lang.String |
getSymbol()
Returns the symbol for this alternate unit. |
int |
hashCode()
Returns the hash code for this unit. |
UnitConverter |
toStandardUnit()
Returns the converter from this unit to its system unit. |
Methods inherited from class javax.measure.unit.Unit |
---|
alternate, asType, compound, divide, divide, divide, getConverterTo, getDimension, inverse, isCompatible, isStandardUnit, plus, pow, root, times, times, times, toString, transform, valueOf |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public final java.lang.String getSymbol()
public final Unit<? super Q> getParent()
public final Unit<? super Q> getStandardUnit()
Unit
base unit
, alternate
unit
or product of base units and alternate units this unit is derived
from. The standard unit identifies the "type" of
quantity
for which this unit is employed.
For example:[code]
boolean isAngularVelocity(Unit> u) {
return u.getStandardUnit().equals(RADIAN.divide(SECOND));
}
assert(REVOLUTION.divide(MINUTE).isAngularVelocity());
[/code]
Note: Having the same system unit is not sufficient to ensure that a converter exists between the two units (e.g. °C/m and K/m).
getStandardUnit
in class Unit<Q extends Quantity>
public final UnitConverter toStandardUnit()
Unit
toStandardUnit
in class Unit<Q extends Quantity>
this.getConverterTo(this.getSystemUnit())
public boolean equals(java.lang.Object that)
equals
in class Unit<Q extends Quantity>
that
- the object to compare for equality.
true
if this
and that
are considered equals; false
otherwise.public int hashCode()
Unit
hashCode
in class Unit<Q extends Quantity>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |