Package org.vast.unit

Class UnitParserUCUM

java.lang.Object
org.vast.unit.UnitParserUCUM
All Implemented Interfaces:
UnitParser

public class UnitParserUCUM extends Object implements UnitParser

Parses a string containing a UCUM unit definition and create a Unit object with the right scale factors and powers.

Since:
May 4, 2006
  • Constructor Details

    • UnitParserUCUM

      public UnitParserUCUM()
  • Method Details

    • getUnit

      public Unit getUnit(String ucumDef)
      Get a Unit object corresponding to the given UCUM string
      Specified by:
      getUnit in interface UnitParser
      Parameters:
      ucumDef - the UCUM string
      Throws:
      IllegalArgumentException - if UCUM string passed as argument is invalid
    • findUnit

      public Unit findUnit(String ucumDef)
      Get a Unit object corresponding to the given UCUM string
      Parameters:
      ucumDef -
      Returns:
      The unit instance or null of no unit can be constructed for the given UCUM string
    • isValidUnit

      public static boolean isValidUnit(String ucumDef)
    • getUnitTable

      public static Map<String,Unit> getUnitTable()