Package net.sf.basedb.util.units
Class IdentityUnitConverter
- java.lang.Object
-
- net.sf.basedb.util.units.IdentityUnitConverter
-
- All Implemented Interfaces:
UnitConverter
public class IdentityUnitConverter extends Object implements UnitConverter
A unit "converter" that doesn't modify the values.- Version:
- 2.9
- Author:
- Nicklas
- Last modified
- $Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
-
Constructor Summary
Constructors Constructor Description IdentityUnitConverter()
Create a new unit converter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
convertToReferenceUnit(double specific)
Convert a value from the specific unit to the reference unit.double
convertToSpecificUnit(double ref)
Convert a value from the reference unit to the specific unit.
-
-
-
Method Detail
-
convertToReferenceUnit
public double convertToReferenceUnit(double specific)
Description copied from interface:UnitConverter
Convert a value from the specific unit to the reference unit.- Specified by:
convertToReferenceUnit
in interfaceUnitConverter
- Parameters:
specific
- The value to convert- Returns:
- The 'specific' value unmodified
-
convertToSpecificUnit
public double convertToSpecificUnit(double ref)
Description copied from interface:UnitConverter
Convert a value from the reference unit to the specific unit.- Specified by:
convertToSpecificUnit
in interfaceUnitConverter
- Parameters:
ref
- The reference value- Returns:
- The 'ref' value unmodified
-
-