Package org.geotools.imageio.netcdf
Class NetCDFUnitFormat
Object
BaseUnitFormatter
NetCDFUnitFormat
- All Implemented Interfaces:
UnitFormatter
Parser/Encoder for units expressed in the NetCDF CF syntax, with ability to configure the unit syntax transformation
and allow setting up custom aliases just for the NetCDF case.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic NetCDFUnitFormat
static NetCDFUnitFormat
Creates a NetCDFUnitFormat with the built-in defaults.static NetCDFUnitFormat
static LinkedHashMap<String,
String> Loads a properties file preserving its internal orderUnit<?>
Parses a unit applying the configured set of replacements and aliasesvoid
setAliases
(Map<String, String> aliases) Configures the aliases to be used on the unit parser.void
setReplacements
(Map<String, String> replacements) Configures the string replacements to be performed before trying to parse the units.Methods inherited from class BaseUnitFormatter
addAlias, addLabel, format, isUnitIdentifierPart, isValidIdentifier, nameFor, parse, parse, parseObject, parseProductUnit, parseSingleUnit, prefixFor, toString
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface UnitFormatter
format
-
Field Details
-
NETCDF_UNIT_ALIASES
Unit aliases config file name (normally looked up in the classpath)- See Also:
-
NETCDF_UNIT_REPLACEMENTS
Unit replacements config file name (normally looked up in the classpath)- See Also:
-
-
Method Details
-
getInstance
-
createWithBuiltInConfig
Creates a NetCDFUnitFormat with the built-in defaults. -
create
-
builtInReplacements
-
builtInAliases
-
loadPropertiesOrdered
Loads a properties file preserving its internal order- Parameters:
is
- The input stream to be read- Returns:
- The contents as a
LinkedHashMap
preserving the file contents
-
setReplacements
Configures the string replacements to be performed before trying to parse the units.- Parameters:
replacements
- The replacements to be used. It is strongly advised to use aLinkedHashMap
as replacements are run from top to bottom, in order, and the order might influence the results
-
setAliases
Configures the aliases to be used on the unit parser. An alias is a different name for a unit. -
parse
Parses a unit applying the configured set of replacements and aliases
-