Package javax.measure.unit
Class CompoundUnit<Q extends Quantity>
java.lang.Object
javax.measure.unit.Unit<Q>
javax.measure.unit.DerivedUnit<Q>
javax.measure.unit.CompoundUnit<Q>
- All Implemented Interfaces:
Serializable
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
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates if this compound unit is considered equals to the specified object (both are compound units with same composing units in the same order).Returns the higher unit of this compound unit.getLower()Returns the lower unit of this compound unit.Returns thebase unit,alternate unitor product of base units and alternate units this unit is derived from.inthashCode()Returns the hash code for this unit.Returns the converter from this unit to its system unit.
-
Method Details
-
getLower
Returns the lower unit of this compound unit.- Returns:
- the lower unit.
-
getHigher
Returns the higher unit of this compound unit.- Returns:
- the higher unit.
-
equals
Indicates if this compound unit is considered equals to the specified object (both are compound units with same composing units in the same order). -
hashCode
public int hashCode()Description copied from class:UnitReturns the hash code for this unit. -
getStandardUnit
Description copied from class:UnitReturns thebase unit,alternate unitor product of base units and alternate units this unit is derived from. The standard unit identifies the "type" ofquantityfor 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).
- Specified by:
getStandardUnitin classUnit<Q extends Quantity>- Returns:
- the system unit this unit is derived from.
-
toStandardUnit
Description copied from class:UnitReturns the converter from this unit to its system unit.- Specified by:
toStandardUnitin classUnit<Q extends Quantity>- Returns:
this.getConverterTo(this.getSystemUnit())
-