Class UnitFactory

java.lang.Object
noaa.coastwatch.util.UnitFactory

public class UnitFactory extends Object
The UnitFactory class creates Unidata UDUNITS style Unit objects from unit specification strings. This is simply a convenience factory that uses the ucar.units package. A number of aliases are also added to the parser to handle legacy CoastWatch unit specifications.
Since:
3.2.0
Author:
Peter Hollemans
  • Constructor Details

    • UnitFactory

      public UnitFactory()
  • Method Details

    • create

      public static ucar.units.Unit create(String unitSpec)
      Creates a unit based on a unit specifier string.
      Parameters:
      unitSpec - the unit specifier string.
      Returns:
      the new unit.
      Throws:
      IllegalArgumentException - if the unit specifier does not resolve to a valid unit.