visad.data.units
Class Parser
- java.lang.Object
-
- visad.data.units.Parser
-
- Direct Known Subclasses:
- Parser
public class Parser extends java.lang.ObjectClass for parsing unit specifications.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static Parserinstance()Obtain the singleton instance of this class.static voidmain(java.lang.String[] args)Test this class.static Unitparse(java.lang.String spec)Parse a string unit-specification.
-
-
-
Method Detail
-
instance
public static Parser instance()
Obtain the singleton instance of this class. Strictly speaking, this isn't necessary sinceparse()is a class method.
-
parse
public static Unit parse(java.lang.String spec) throws ParseException, NoSuchUnitException
Parse a string unit-specification.- Parameters:
spec- The string unit-specification.- Throws:
ParseException- An error occurred while parsing the specification.UnitException- ifspecrequires an unsupported operation.NoSuchUnitException
-
main
public static void main(java.lang.String[] args) throws ParseException, UnitExceptionTest this class.- Throws:
ParseExceptionUnitException
-
-
DMelt 3.0 © DataMelt by jWork.ORG