Package org.ka2ddo.util
Interface UnitEnum<T>
- All Known Subinterfaces:
UnitEnumHasShortUnit<T>
- All Known Implementing Classes:
DistanceUnit
,PressureUnit
,TemperatureUnit
,WeightUnit
public interface UnitEnum<T>
This is a tag interface identifying that the tagged enumeration is a definition of units of measure of some sort.
- Author:
- Andrew Pavlin, KA2DDO
-
Method Summary
-
Method Details
-
from
Get the multiplicative conversion factor to convert a value from the specified units to this unit.- Parameters:
other
- another T representing the existing units of a value- Returns:
- the conversion factor to change a value into this unit
-
getOffset
Get the additive offset to convert a value from the specified unit to this unit.- Parameters:
other
- another T representing the existing units of a value- Returns:
- the offset (after multiplying by the from() factor) to add to get the value in this unit
-