Package net.sf.basedb.util.units
Class IdentityUnitConverter
java.lang.Object
net.sf.basedb.util.units.IdentityUnitConverter
- All Implemented Interfaces:
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
-
Method Summary
Modifier and TypeMethodDescriptiondouble
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.
-
Constructor Details
-
IdentityUnitConverter
public IdentityUnitConverter()Create a new unit converter.
-
-
Method Details
-
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
-