Package javax.measure.quantity


package javax.measure.quantity
[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 Quantity interface.

Only quantities defined in the BIPM - SI Brochure are provided here. Users can create their own quantity types by extending the Quantity interface.

This package supports measurable quantities, which can be expressed as (Number, 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 double primitive type with the requirement to provide values in meters) before computation begins.

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 Unit interface, but users can apply the same approach to their own classes. In the example below, Sensor, MyQuantity and 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.

Since:
1.0
Version:
2.8
Author:
Jean-Marie Dautelle, Werner Keil
See Also:
  • Interfaces
    Class
    Description
    Rate of change of velocity with respect to time.
    Number of elementary entities (molecules, for example) of a substance.
    Figure formed by two lines diverging from a common point.
    Extent of a planar region or of the surface of a solid measured in square units.
    Catalytic activity.
    Dimensionless quantity.
    Electric capacitance.
    Electric charge.
    Electric conductance.
    Amount of electric charge flowing past a specified circuit point per unit time.
    Electric inductance.
    Electric potential or electromotive force.
    Electric resistance.
    Capacity of a physical system to do work.
    Quantity that tends to produce an acceleration of a body in the direction of its application.
    Number of times a specified phenomenon occurs within a specified interval.
    Illuminance.
    Extent of something along its greatest dimension or the extent of space between two objects or places.
    Luminous flux.
    Luminous flux density per solid angle as measured in a given direction relative to the emitting source.
    Magnetic flux.
    Magnetic flux density.
    Measure of the quantity of matter that a body or an object contains.
    Rate at which work is done.
    Force applied uniformly over a surface.
    Amount of energy deposited per unit of mass.
    Effective (or "equivalent") dose of radiation received by a human or some other living organism.
    Radioactive activity.
    Angle formed by three or more planes intersecting at a common point.
    Distance traveled divided by the time of travel.
    Degree of hotness or coldness of a body or an environment.
    Period of existence or persistence.
    Amount of space occupied by a three-dimensional object or region of space.