Package tech.units.indriya
Interface ComparableUnit<Q extends javax.measure.Quantity<Q>>
-
- Type Parameters:
Q-
- All Superinterfaces:
Comparable<javax.measure.Unit<Q>>,Serializable,javax.measure.Unit<Q>
- All Known Implementing Classes:
AbstractUnit,AlternateUnit,AnnotatedUnit,BaseUnit,ProductUnit,TransformedUnit
public interface ComparableUnit<Q extends javax.measure.Quantity<Q>> extends javax.measure.Unit<Q>, Comparable<javax.measure.Unit<Q>>, Serializable
- Since:
- 1.0.9
- Version:
- 1.4, July 2, 2019
- Author:
- werner
-
-
Method Summary
Modifier and Type Method Description javax.measure.UnitConvertergetSystemConverter()Returns the converter from this unit to its unscaledSystem Unitunit.javax.measure.Unit<Q>getSystemUnit()Returns the system unit (unscaled SI unit) from which this unit is derived.booleanisEquivalentTo(javax.measure.Unit<Q> that)Compares two instances ofUnit<Q>, doing the conversion of unit if necessary.booleanisSystemUnit()Indicates if this unit belongs to the set of coherent SI units (unscaled SI units).-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
isEquivalentTo
boolean isEquivalentTo(javax.measure.Unit<Q> that)
Compares two instances ofUnit<Q>, doing the conversion of unit if necessary.- Parameters:
that- theUnit<Q>to be compared with this instance.- Returns:
trueifthat < this.- Throws:
NullPointerException- if the unit is null- See Also:
- Cambridge Dictionary: equivalent, LEXICO: equivalent
-
isSystemUnit
boolean isSystemUnit()
Indicates if this unit belongs to the set of coherent SI units (unscaled SI units). The base and coherent derived units of the SI form a coherent set, designated the set of coherent SI units. The word coherent is used here in the following sense: when coherent units are used, equations between the numerical values of quantities take exactly the same form as the equations between the quantities themselves. Thus if only units from a coherent set are used, conversion factors between units are never required.- Returns:
equals(toSystemUnit())
-
getSystemUnit
javax.measure.Unit<Q> getSystemUnit()
Returns the system unit (unscaled SI unit) from which this unit is derived. They can be be used to identify a quantity given the unit. For example:
static boolean isAngularVelocity(AbstractUnit> unit) {
return unit.getSystemUnit().equals(RADIAN.divide(SECOND));
}
assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true.
-
getSystemConverter
javax.measure.UnitConverter getSystemConverter()
Returns the converter from this unit to its unscaledSystem Unitunit.- Returns:
getConverterTo(this.toSystemUnit())- See Also:
#toSystemUnit
-
-