src/main/java/ucar/geoapi/Units.java
static synchronized Unit<?> parse(final String symbol) throws ParserException {
        if (unitFormat == null) {
            ServiceProvider provider = ServiceProvider.current();
            if (provider != null) {
                UnitFormatService fs = provider.getUnitFormatService();
                if (fs != null) {
                    unitFormat = fs.getUnitFormat();
                }
            }
            if (unitFormat == null) {
                throw new ParserException("Can not parse unit symbol because no UnitFormat has been found on the classpath.", symbol, 0);
            }
        }
        try {
            return unitFormat.parse(symbol);
        } catch (ParserException e) {
            /*
             * Workaround for symbols found in some netCDF files
             * but not recognized by all {@link UnitFormat} parsers.
             */
            // Angular units
            if (symbol.equalsIgnoreCase(   "rad") ||
                equalsIgnorePlural(symbol, "radian"))         return RADIAN;
            if (equalsIgnorePlural(symbol, "degree") ||
                equalsIgnorePlural(symbol, "decimal_degree")) return DEGREE;
            if (equalsIgnorePlural(symbol, "grad"))           return GRAD;
            if (symbol.equalsIgnoreCase(   "arcsec"))         return ARC_SECOND;

            // Linear units
            if (equalsIgnorePlural(symbol, "meter") ||
                equalsIgnorePlural(symbol, "metre"))       return METRE;
            if (equalsIgnorePlural(symbol, "kilometer") ||
                equalsIgnorePlural(symbol, "kilometre"))   return KILOMETRE;
            if (symbol.equalsIgnoreCase("US survey foot")) return FOOT_SURVEY_US;
            if (symbol.equalsIgnoreCase("foot"))           return FOOT;
            if (symbol.equalsIgnoreCase("100 feet"))       return METRE.multiply(30.48);

            // Temporal units
            if (equalsIgnorePlural(symbol, "day"))    return DAY;
            if (equalsIgnorePlural(symbol, "hour"))   return HOUR;
            if (equalsIgnorePlural(symbol, "minute")) return MINUTE;
            if (equalsIgnorePlural(symbol, "second")) return SECOND;

            // Dimensionless units
            if (symbol.equalsIgnoreCase("ppm")) return PPM;
            if (symbol.isEmpty())               return ONE;
            throw e;
        }
    }
/**
     * Parses the given symbol using the {@link UnitFormat} instance provided by whatever JSR-363
     * implementation is found on the classpath. The same instance is reused for all units to parse.
     */
Parses the given symbol using the  UnitFormat instance provided by whatever JSR-363
implementation is found on the classpath. The same instance is reused for all units to parse.
Parses the given symbol using the UnitFormat instance provided by whatever JSR - 363 implementation is found on the classpath . The same instance is reused for all units to parse .
static synchronized Unit<?> parse(final String symbol) throws ParserException {
        if (unitFormat == null) {
            ServiceProvider provider = ServiceProvider.current();
            if (provider != null) {
                UnitFormatService fs = provider.getUnitFormatService();
                if (fs != null) {
                    unitFormat = fs.getUnitFormat();
                }
            }
            if (unitFormat == null) {
                throw new ParserException("Can not parse unit symbol because no UnitFormat has been found on the classpath.", symbol, 0);
            }
        }
        try {
            return unitFormat.parse(symbol);
        } catch (ParserException e) {
            /*
             * Workaround for symbols found in some netCDF files
             * but not recognized by all {@link UnitFormat} parsers.
             */
            if (symbol.equalsIgnoreCase(   "rad") ||
                equalsIgnorePlural(symbol, "radian"))         return RADIAN;
            if (equalsIgnorePlural(symbol, "degree") ||
                equalsIgnorePlural(symbol, "decimal_degree")) return DEGREE;
            if (equalsIgnorePlural(symbol, "grad"))           return GRAD;
            if (symbol.equalsIgnoreCase(   "arcsec"))         return ARC_SECOND;
            if (equalsIgnorePlural(symbol, "meter") ||
                equalsIgnorePlural(symbol, "metre"))       return METRE;
            if (equalsIgnorePlural(symbol, "kilometer") ||
                equalsIgnorePlural(symbol, "kilometre"))   return KILOMETRE;
            if (symbol.equalsIgnoreCase("US survey foot")) return FOOT_SURVEY_US;
            if (symbol.equalsIgnoreCase("foot"))           return FOOT;
            if (symbol.equalsIgnoreCase("100 feet"))       return METRE.multiply(30.48);
            if (equalsIgnorePlural(symbol, "day"))    return DAY;
            if (equalsIgnorePlural(symbol, "hour"))   return HOUR;
            if (equalsIgnorePlural(symbol, "minute")) return MINUTE;
            if (equalsIgnorePlural(symbol, "second")) return SECOND;
            if (symbol.equalsIgnoreCase("ppm")) return PPM;
            if (symbol.isEmpty())               return ONE;
            throw e;
        }
    }
static synchronized Unit < ? > parse ( final String symbol ) throws ParserException { if ( unitFormat == null ) { ServiceProvider provider = ServiceProvider . current ( ) ; if ( provider != null ) { UnitFormatService fs = provider . getUnitFormatService ( ) ; if ( fs != null ) { unitFormat = fs . getUnitFormat ( ) ; } } if ( unitFormat == null ) { throw new ParserException ( "Can not parse unit symbol because no UnitFormat has been found on the classpath." , symbol , 0 ) ; } } try { return unitFormat . parse ( symbol ) ; } catch ( ParserException e ) { /*
             * Workaround for symbols found in some netCDF files
             * but not recognized by all {@link UnitFormat} parsers.
             */ if ( symbol . equalsIgnoreCase ( "rad" ) || equalsIgnorePlural ( symbol , "radian" ) ) return RADIAN ; if ( equalsIgnorePlural ( symbol , "degree" ) || equalsIgnorePlural ( symbol , "decimal_degree" ) ) return DEGREE ; if ( equalsIgnorePlural ( symbol , "grad" ) ) return GRAD ; if ( symbol . equalsIgnoreCase ( "arcsec" ) ) return ARC_SECOND ; if ( equalsIgnorePlural ( symbol , "meter" ) || equalsIgnorePlural ( symbol , "metre" ) ) return METRE ; if ( equalsIgnorePlural ( symbol , "kilometer" ) || equalsIgnorePlural ( symbol , "kilometre" ) ) return KILOMETRE ; if ( symbol . equalsIgnoreCase ( "US survey foot" ) ) return FOOT_SURVEY_US ; if ( symbol . equalsIgnoreCase ( "foot" ) ) return FOOT ; if ( symbol . equalsIgnoreCase ( "100 feet" ) ) return METRE . multiply ( 30.48 ) ; if ( equalsIgnorePlural ( symbol , "day" ) ) return DAY ; if ( equalsIgnorePlural ( symbol , "hour" ) ) return HOUR ; if ( equalsIgnorePlural ( symbol , "minute" ) ) return MINUTE ; if ( equalsIgnorePlural ( symbol , "second" ) ) return SECOND ; if ( symbol . equalsIgnoreCase ( "ppm" ) ) return PPM ; if ( symbol . isEmpty ( ) ) return ONE ; throw e ; } }
Parses the given symbol using the {@link UnitFormat} instance provided by whatever JSR-363
 implementation is found on the classpath.
Parses the given symbol using the { @link UnitFormat } instance provided by whatever JSR - 363 implementation is found on the classpath .
// Angular units // Linear units // Temporal units // Dimensionless units