All Downloads are FREE. Search and download functionalities are using the official Maven repository.

systems.uom.ucum.UCUM Maven / Gradle / Ivy

There is a newer version: 2.1
Show newest version
/*
 * Units of Measurement Systems
 * Copyright (c) 2005-2019, Jean-Marie Dautelle, Werner Keil and others.
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
 *    and the following disclaimer in the documentation and/or other materials provided with the distribution.
 *
 * 3. Neither the name of JSR-385, Units of Measurement nor the names of their contributors may be used to
 *    endorse or promote products derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package systems.uom.ucum;

import static javax.measure.MetricPrefix.*;
import static tech.units.indriya.AbstractUnit.ONE;

import si.uom.quantity.*;
import systems.uom.quantity.Acidity;
import systems.uom.quantity.Concentration;
import systems.uom.quantity.Drag;
import systems.uom.quantity.Information;
import systems.uom.quantity.InformationRate;
import si.uom.quantity.Level;
import si.uom.SI;
import tech.units.indriya.*;
import tech.units.indriya.format.SimpleUnitFormat;
import tech.units.indriya.function.LogConverter;
import tech.units.indriya.function.MultiplyConverter;
import tech.units.indriya.unit.AlternateUnit;
import tech.units.indriya.unit.ProductUnit;
import tech.units.indriya.unit.TransformedUnit;
import tech.units.indriya.unit.Units;

import javax.measure.Quantity;
import javax.measure.Unit;
import javax.measure.quantity.*;

/**
 * 

* This class contains {@link SI} and Non-SI units as defined in the * Unified Code for Units of Measure. *

* *

* Compatibility with {@link SI} units has been given priority over strict * adherence to the standard. We have attempted to note every place where the * definitions in this class deviate from the UCUM standard, but such notes are * likely to be incomplete. *

* * @author Eric Russell * @author Werner Keil * @see UCUM * @version 2.1, $Date: 2019-10-02 $ */ public final class UCUM extends AbstractSystemOfUnits { /** * The singleton instance. */ private static final UCUM INSTANCE = new UCUM(); /** * Default constructor (prevents this class from being instantiated). */ private UCUM() { } /** * Returns the singleton instance of this class. * * @return the UCUM system instance. */ public static UCUM getInstance() { return INSTANCE; } ////////////////////////////// // BASE UNITS: UCUM 4.2 §28 // ////////////////////////////// /** As per UCUM standard. */ public static final Unit METER = addUnit(Units.METRE); /** As per UCUM standard. */ public static final Unit