public class NetCDFUnitFormat extends Object
Modifier and Type | Class and Description |
---|---|
static class |
NetCDFUnitFormat.AbstractNetCDFUnitFormat
We want to use a separate instance during re-configuration and get isolation from the normal
formatters, this abstract class allows to do the trick.
|
Modifier and Type | Field and Description |
---|---|
static String |
NETCDF_UNIT_ALIASES
Unit aliases config file name (normally looked up in the classpath)
|
static String |
NETCDF_UNIT_REPLACEMENTS
Unit replacements config file name (normally looked up in the classpath)
|
Modifier and Type | Method and Description |
---|---|
static String |
format(Unit<?> unit)
Formats the unit
|
static LinkedHashMap<String,String> |
loadPropertiesOrdered(InputStream is)
Loads a properties file preserving its internal order
|
static Unit<?> |
parse(String spec)
Parses a unit applying the configured set of replacements and aliases
|
static void |
reset()
Resets the format to the built-in defaults
|
static void |
setAliases(Map<String,String> aliases)
Configures the aliases to be used on the unit parser.
|
static void |
setReplacements(Map<String,String> replacements)
Configures the string replacements to be performed before trying to parse the units.
|
public static final String NETCDF_UNIT_ALIASES
public static final String NETCDF_UNIT_REPLACEMENTS
public static void reset()
public static void setReplacements(Map<String,String> replacements)
replacements
- The replacements to be used. It is strongly advised to use a LinkedHashMap
as replacements are run from top to bottom, in order, and the order might
influence the resultspublic static LinkedHashMap<String,String> loadPropertiesOrdered(InputStream is)
is
- The input stream to be readLinkedHashMap
preserving the file contentspublic static void setAliases(Map<String,String> aliases)
aliases
- public static Unit<?> parse(String spec)
public static String format(Unit<?> unit)
unit
- The unit to be formattedCopyright © 1996–2019 Geotools. All rights reserved.