public final class CompoundUnit<Q extends Quantity> extends DerivedUnit<Q>
This class represents the multi-radix units (such as "hour:min:sec").
Instances of this class are created using the Unit.compound
method.
Examples of compound units:[code]
Unit
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object that)
Indicates if this compound unit is considered equals to the specified
object (both are compound units with same composing units in the
same order).
|
Unit<Q> |
getHigher()
Returns the higher unit of this compound unit.
|
Unit<Q> |
getLower()
Returns the lower unit of this compound unit.
|
Unit<? super Q> |
getStandardUnit()
Returns the
base unit , alternate
unit or product of base units and alternate units this unit is derived
from. |
int |
hashCode()
Returns the hash code for this unit.
|
UnitConverter |
toStandardUnit()
Returns the converter from this unit to its system unit.
|
public Unit<Q> getLower()
public Unit<Q> getHigher()
public boolean equals(java.lang.Object that)
public int hashCode()
Unit
public 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 UnitConverter toStandardUnit()
Unit
toStandardUnit
in class Unit<Q extends Quantity>
this.getConverterTo(this.getSystemUnit())