org.n52.oxf.conversion.unit.ucum
Class UCUMTools
java.lang.Object
org.n52.oxf.conversion.unit.ucum.UCUMTools
public class UCUMTools
- extends Object
Unit conversion utils based on the Unified Code for
Units of Measure: http://unitsofmeasure.org
Method Summary |
static NumberWithUOM |
convert(String sourceUnitString,
double value)
Converts the number to its base unit (e.g. kilometers to meters) |
static NumberWithUOM |
convert(String sourceUnitString,
String targetUnitString,
double value)
Converts the number to the target unit. |
static boolean |
isCompatible(String unitString1,
String unitString2)
Checks if to UCUM codes are compatible (= having the same base unit) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UCUMTools
public UCUMTools()
convert
public static NumberWithUOM convert(String sourceUnitString,
double value)
- Converts the number to its base unit (e.g. kilometers to meters)
convert
public static NumberWithUOM convert(String sourceUnitString,
String targetUnitString,
double value)
throws UCUMTools.UnitConversionFailedException
- Converts the number to the target unit. Inputs are Strings
representing UCUM codes.
- Throws:
UCUMTools.UnitConversionFailedException
isCompatible
public static boolean isCompatible(String unitString1,
String unitString2)
- Checks if to UCUM codes are compatible (= having the same base unit)
Copyright © 2012-2013 52north.org. All Rights Reserved.