public class EDUnits extends Object
| Modifier and Type | Field and Description |
|---|---|
static String[] |
metricAcronym |
static String[] |
metricName
UDUNITS and UCUM support metric prefixes.
|
static int |
nMetric |
static int |
nTwo |
static String[] |
twoAcronym
UCUM supports power-of-two prefixes, but UDUNITS doesn't.
|
static String[] |
twoValue |
| Constructor and Description |
|---|
EDUnits() |
| Modifier and Type | Method and Description |
|---|---|
static HashMap<String,String> |
getHashMapStringString(InputStream inputStream,
String charset)
Reads the contents of
inputStream into a HashMap. |
static String |
ucumToUdunits(String ucum)
This converts UCUM to UDUnits.
|
static String |
udunitsToUcum(String udunits)
This converts UDUnits to UCUM.
|
public static String[] metricName
public static String[] metricAcronym
public static int nMetric
public static String[] twoAcronym
public static String[] twoValue
public static int nTwo
public static String udunitsToUcum(String udunits)
UDUnits supports lots of aliases (short and long) and plurals (usually by adding 's'). These all get reduced to UCUM's short and canonical-only units.
Notes:
public static String ucumToUdunits(String ucum)
UCUM tends to be short, canonical-only, and strict. Many UCUM units are the same in UDUnits.
UDUnits supports lots of aliases (short and long) and plurals (usually by adding 's'). This tries to convert UCUM to a short, common UDUNIT units.
Problems:
Notes:
public static HashMap<String,String> getHashMapStringString(InputStream inputStream, String charset) throws IOException
inputStream into a HashMap. Each key-value pair in the input will result in an
entry in the map.
The specified stream remains open after this method returns.inputStream - a stream with line-based, key-value pairs.charset - the name of a supported charset.IOException - if an I/O error occursCopyright © 1999–2014 UCAR/Unidata. All rights reserved.