public class ErddapEDUnits
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
metricAcronym |
static java.lang.String[] |
metricName
UDUNITS and UCUM support metric prefixes.
|
static int |
nMetric |
static int |
nTwo |
static java.lang.String[] |
twoAcronym
UCUM supports power-of-two prefixes, but UDUNITS doesn't.
|
static java.lang.String[] |
twoValue |
Constructor and Description |
---|
ErddapEDUnits() |
Modifier and Type | Method and Description |
---|---|
static java.util.HashMap<java.lang.String,java.lang.String> |
getHashMapStringString(java.io.InputStream inputStream,
java.lang.String charset)
Reads the contents of
inputStream into a HashMap. |
static java.lang.String |
ucumToUdunits(java.lang.String ucum)
This converts UCUM to UDUnits.
|
static java.lang.String |
udunitsToUcum(java.lang.String udunits)
This converts UDUnits to UCUM.
|
public static java.lang.String[] metricName
public static java.lang.String[] metricAcronym
public static int nMetric
public static java.lang.String[] twoAcronym
public static java.lang.String[] twoValue
public static int nTwo
public static java.lang.String udunitsToUcum(java.lang.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 java.lang.String ucumToUdunits(java.lang.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 java.util.HashMap<java.lang.String,java.lang.String> getHashMapStringString(java.io.InputStream inputStream, java.lang.String charset) throws java.io.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
.java.io.IOException
- if an I/O error occurs