|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UnitConverter
Interface for converting values between two units. A unit converter implemenation usually has a notion of a specific unit and a reference unit, which are the two units the converter can convert values from.
If rounding errors and truncation is ignored the following should
hold for any implementation:
value == converter.convertFrom(converter.convertTo(value))
Method Summary | |
---|---|
double |
convertToReferenceUnit(double specificValue)
Convert a value from the specific unit to the reference unit. |
double |
convertToSpecificUnit(double referenceValue)
Convert a value from the reference unit to the specific unit. |
Method Detail |
---|
double convertToReferenceUnit(double specificValue)
specificValue
- The value to convert
double convertToSpecificUnit(double referenceValue)
referenceValue
- The reference value
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |