Units of Measurement API specifies one or more Java packages for the programmatic handling of physical quantities and their expression as numbers of units. The specification includes:
Interfaces and abstract classes with methods for unit operations:
Checking of unit compatibility
Expression of a quantity in various units
Arithmetic operations on units
Concrete classes implementing the standard types of units (such as base, supplementary, and derived) and unit conversions
Classes for parsing unit specifications in string form and for formatting string representations of quantities.
A database of predefined units.
Developers frequently encounter the need to model units of measure, because objects in the real world are subject to these measures. When working with units, developers need to understand the mathematics of units, how to convert between systems, and how to format and parse string representations of units. Most of this work can be consolidated into one or two Java packages, which is a primary aim of this API. This package will help developers create safe, correct software to deal with common problem of modeling units.