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

javax.measure.quantity.package-info Maven / Gradle / Ivy

Go to download

Units of Measurement Standard - This JSR specifies Java packages for modeling and working with measurement values, quantities and their corresponding units.

The newest version!
/*
 * Units of Measurement API
 * Copyright (c) 2014-2023, Jean-Marie Dautelle, Werner Keil, Otavio Santana.
 *
 * 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 nor the names of its 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.
 */
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//

/**
 * [OPTIONAL] Provides quantitative properties or attributes of thing such as
 * mass, time, distance, heat, and angular separation.
 * Quantities of different kinds are represented by sub-types of the
 * {@link javax.measure.Quantity} interface.
 *
 * 

Only quantities defined in the BIPM - SI Brochure * are provided here. Users can create their own quantity types by extending the * {@link javax.measure.Quantity Quantity} interface.

* *

This package supports measurable quantities, which can be expressed * as ({@link java.lang.Number}, {@link javax.measure.Unit}) tuples. * Those tuples are not necessarily used directly in numerically intensive code. * They are more useful as meta-data converted to the application internal representation * (for example {@code double} primitive type with the requirement to provide values in meters) * before computation begins.

* *

{@link javax.measure.Quantity Quantity} sub-types are also used as parameterized type to characterize * generic classes and provide additional compile time check. This technique is * used extensively by the {@link javax.measure.Unit} interface, * but users can apply the same approach to their own classes. In the example * below, {@code Sensor}, {@code MyQuantity} and {@code Vector3D} are user-defined * classes:

* * * // A general-purpose Sensor class used for temperature measurements:
* Sensor<Temperature> sensor ...;
* Temperature temp = sensor.getValue();

* * // A vector of velocity in a three-dimensional space.
* Unit<Speed> = metrePerSecond = METRE.divide(SECOND);
* Vector3D<Speed> aircraftSpeed = new Vector3D(200.0, 50.0, -0.5, metrePerSecond); *
* *

This package holds only the quantities required by the metric system.

* * @author Jean-Marie Dautelle * @author Werner Keil * @version 2.8 * @since 1.0 * @see Wikipedia: International System of Units * @see Wikipedia: 2019 redefinition of the SI base units */ package javax.measure.quantity;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy