Top Description Fields Constructors Methods
tech.units.indriya.unit

public Class Units

extends AbstractSystemOfUnits
Class Inheritance
Static Imports
tech.units.indriya.AbstractUnit.ONE

This class defines common units.
It is a representative subset of the SI system.
Authors
Werner Keil, Teo Bais
Since
1.0
Version
3.0 January 17, 2024
See Also
USMA: Detailed list of metric system units, symbols, and prefixes, Wikipedia: International System of Units

Field Summary

Modifier and TypeField and Description
public static final Unit<ElectricCurrent>
AMPERE

The ampere, symbol A, is the SI unit of electric current.

public static final Unit<Radioactivity>
BECQUEREL

The SI unit for activity of a radionuclide (standard name Bq ).

public static final Unit<LuminousIntensity>
CANDELA

The candela, symbol cd, is the SI unit of luminous intensity in a given direction.

public static final Unit<Temperature>
CELSIUS

The SI unit for Celsius temperature (standard name °C).

public static final Unit<ElectricCharge>
COULOMB

The SI unit for electric charge, quantity of electricity (standard name C).

public static final Unit<Volume>
CUBIC_METRE

The SI unit for volume quantities (standard name m3).

public static final Unit<Time>
DAY

A time unit accepted for use with SI units (standard name d ).

public static final Unit<ElectricCapacitance>
FARAD

The SI unit for capacitance (standard name F).

public static final Unit<Mass>
GRAM

The SI derived unit for mass quantities (standard name g).

public static final Unit<RadiationDoseAbsorbed>
GRAY

The SI unit for absorbed dose, specific energy (imparted), kerma (standard name Gy).

public static final Unit<ElectricInductance>
HENRY

The alternate unit for inductance (standard name H).

public static final Unit<Frequency>
HERTZ

The SI unit for frequency (standard name Hz).

public static final Unit<Time>
HOUR

A time unit accepted for use with SI units (standard name h ).

private static final Units
INSTANCE

Singleton instance

public static final Unit<Energy>
JOULE

The SI unit for energy, work, quantity of heat (J).

public static final Unit<CatalyticActivity>
KATAL

The SI unit for catalytic activity (standard name kat).

public static final Unit<Temperature>
KELVIN

The kelvin, symbol K, is the SI unit of thermodynamic temperature.

public static final Unit<Mass>
KILOGRAM

The kilogram, symbol kg, is the SI unit of mass.

public static final Unit<Speed>
KILOMETRE_PER_HOUR

A unit of speed expressing the number of international kilometres per hour (abbreviation km/h).

public static final Unit<Volume>
LITRE

A volume unit accepted for use with SI units (standard name l).

public static final Unit<LuminousFlux>
LUMEN

The SI unit for luminous flux (standard name lm).

public static final Unit<Illuminance>
LUX

The SI unit for illuminance (standard name lx).

public static final Unit<Length>
METRE

The metre, symbol m, is the SI unit of length.

public static final Unit<Speed>
METRE_PER_SECOND

The SI unit for speed quantities (standard name m/s).

public static final Unit<Acceleration>
METRE_PER_SQUARE_SECOND

The SI unit for acceleration quantities (standard name m/s2).

public static final Unit<Time>
MINUTE

A time unit accepted for use with SI units (standard name min).

public static final Unit<AmountOfSubstance>
MOLE

The mole, symbol mol, is the SI unit of amount of substance.

public static final Unit<Time>
MONTH

A unit of duration equal to 1/12 YEAR (common name mo).

public static final Unit<Force>
NEWTON

The SI unit for force (standard name N).

public static final Unit<ElectricResistance>
OHM

The SI unit for electric resistance (standard name Ohm).

public static final Unit<Pressure>
PASCAL

The SI unit for pressure, stress (standard name Pa).

public static final Unit<Dimensionless>
PERCENT

A dimensionless unit accepted for use with SI units (standard name %).

public static final Unit<Angle>
RADIAN

The SI unit for plane angle quantities (standard name rad).

public static final Unit<Time>
SECOND

The second, symbol s, is the SI unit of time.

public static final Unit<ElectricConductance>
SIEMENS

The SI unit for electric conductance (standard name S).

public static final Unit<RadiationDoseEffective>
SIEVERT

The SI unit for dose equivalent (standard name Sv).

public static final Unit<Area>
SQUARE_METRE

The SI unit for area quantities (standard name m2).

public static final Unit<SolidAngle>
STERADIAN

The SI unit for solid angle quantities (standard name sr).

public static final Unit<MagneticFluxDensity>
TESLA

The alternate unit for magnetic flux density (standard name T).

public static final Unit<ElectricPotential>
VOLT

The SI unit for electric potential difference, electromotive force (standard name V).

public static final Unit<Power>
WATT

The SI unit for power, radiant, flux (standard name W).

public static final Unit<MagneticFlux>
WEBER

The SI unit for magnetic flux (standard name Wb).

public static final Unit<Time>
WEEK

A unit of duration equal to 7 DAY (common name wk).

public static final Unit<Time>
YEAR

A time unit accepted for use with SI units (standard name yr ).

Inherited from tech.units.indriya.AbstractSystemOfUnits:
loggerquantityToUnitunits

Constructor Summary

AccessConstructor and Description
protected
Units()

Constructor may only be called by subclasses

Method Summary

Modifier and TypeMethod and Description
protected static <U extends AbstractUnit<?>> U

Returns:

unit.
addUnit
(final Set<Unit<?>>
the set to add to.
units
,
U
the unit being added.
unit
,
String
the string to use as name
name
,
String
the string to use as symbol
symbol
)

Adds a new unit not mapped to any specified quantity type to a set with a name and symbol.

protected static <U extends Unit<?>> U

Returns:

unit.
addUnit
(final Set<Unit<?>>
the set to add to.
units
,
U
the unit being added.
unit
,
String
the string to use as name
name
)

Adds a new unit to a set using a name.

protected static <U extends Unit<?>> U

Returns:

unit.
addUnit
(final Set<Unit<?>>
the set to add to.
units
,
U
the unit being added.
unit
)

Adds a new unit to a set of units.

private static <U extends Unit<?>> U

Returns:

unit.
addUnit
(U
the unit being added.
unit
)

Adds a new unit not mapped to any specified quantity type.

private static <U extends AbstractUnit<?>> U

Returns:

unit.
addUnit
(U
the unit being added.
unit
,
String
the name of the unit being added.
name
,
Class<? extends Quantity<?>>
the quantity type.
type
)

Adds a new unit and maps it to the specified quantity type.

private static <U extends AbstractUnit<?>> U

Returns:

unit.
addUnit
(U
the unit being added.
unit
,
Class<? extends Quantity<?>>
the quantity type.
type
)

Adds a new unit and maps it to the specified quantity type.

public static Units

Returns:

the Units instance.
getInstance
()

Returns the unique instance of this class.

public String
Inherited from tech.units.indriya.AbstractSystemOfUnits:
getUnitgetUnitgetUnitgetUnitgetUnitsgetUnits

Field Detail

AMPEREback to summary
public static final Unit<ElectricCurrent> AMPERE

The ampere, symbol A, is the SI unit of electric current. It is defined by taking the fixed numerical value of the elementary charge e to be 1.602 176 634 × 10⁻¹⁹ when expressed in the unit C, which is equal to A s, where the second is defined in terms of ∆νCs. This definition implies the exact relation e = 1.602 176 634 × 10⁻¹⁹ A s. Inverting this relation gives an exact expression for the unit ampere in terms of the defining constants e and ∆νCs: 1 A = (e / 1.602 176 634 × 10⁻¹⁹) s⁻¹

Implementation Note:
SI Base Unit
BECQUERELback to summary
public static final Unit<Radioactivity> BECQUEREL

The SI unit for activity of a radionuclide (standard name Bq ). One becquerel is the radiation caused by one disintegration per second. It is named after the French physicist, Antoine-Henri Becquerel (1852-1908).

CANDELAback to summary
public static final Unit<LuminousIntensity> CANDELA

The candela, symbol cd, is the SI unit of luminous intensity in a given direction. It is defined by taking the fixed numerical value of the luminous efficacy of monochromatic radiation of frequency 540 × 10¹² Hz, Kcd, to be 683 when expressed in the unit lm W−1, which is equal to cd sr W⁻¹, or cd sr kg⁻¹ m⁻² s³, where the kilogram, metre and second are defined in terms of h, c and ∆νCs. This definition implies the exact relation Kcd = 683 cd sr kg⁻¹ m⁻² s³ for monochromatic radiation of frequency ν = 540 × 10¹² Hz. Inverting this relation gives an exact expression for the candela in terms of the defining constants Kcd, h and ∆νCs: 1 cd = (Kcd / 683) kg m² s⁻³ sr⁻¹

Implementation Note:
SI Base Unit
See Also
Wikipedia: Candela
CELSIUSback to summary
public static final Unit<Temperature> CELSIUS

The SI unit for Celsius temperature (standard name °C). This is a unit of temperature such as the freezing point of water (at one atmosphere of pressure) is 0 °C, while the boiling point is 100 °C.

Annotations
@SuppressWarnings:rawtypes, unchecked
COULOMBback to summary
public static final Unit<ElectricCharge> COULOMB

The SI unit for electric charge, quantity of electricity (standard name C). One Coulomb is equal to the quantity of charge transferred in one second by a steady current of one ampere. It is named after the French physicist Charles Augustin de Coulomb (1736-1806).

Implementation Note:
SI Brochure - Table 4
CUBIC_METREback to summary
public static final Unit<Volume> CUBIC_METRE

The SI unit for volume quantities (standard name m3).

DAYback to summary
public static final Unit<Time> DAY

A time unit accepted for use with SI units (standard name d ).

FARADback to summary
public static final Unit<ElectricCapacitance> FARAD

The SI unit for capacitance (standard name F). One Farad is equal to the capacitance of a capacitor having an equal and opposite charge of 1 coulomb on each plate and a potential difference of 1 volt between the plates. It is named after the British physicist and chemist Michael Faraday (1791-1867).

Implementation Note:
SI Brochure - Table 4
GRAMback to summary
public static final Unit<Mass> GRAM

The SI derived unit for mass quantities (standard name g). The base unit for mass quantity is KILOGRAM.

GRAYback to summary
public static final Unit<RadiationDoseAbsorbed> GRAY

The SI unit for absorbed dose, specific energy (imparted), kerma (standard name Gy). One gray is equal to the dose of one joule of energy absorbed per one kilogram of matter. It is named after the British physician L. H. Gray (1905-1965).

HENRYback to summary
public static final Unit<ElectricInductance> HENRY

The alternate unit for inductance (standard name H). One Henry is equal to the inductance for which an induced electromotive force of one volt is produced when the current is varied at the rate of one ampere per second. It is named after the American physicist Joseph Henry (1791-1878).

HERTZback to summary
public static final Unit<Frequency> HERTZ

The SI unit for frequency (standard name Hz). A unit of frequency equal to one cycle per second. After Heinrich Rudolf Hertz (1857-1894), German physicist who was the first to produce radio waves artificially.

Implementation Note:
SI Brochure - Table 4
HOURback to summary
public static final Unit<Time> HOUR

A time unit accepted for use with SI units (standard name h ).

INSTANCEback to summary
private static final Units INSTANCE

Singleton instance

JOULEback to summary
public static final Unit<Energy> JOULE

The SI unit for energy, work, quantity of heat (J). One joule is the amount of work done when an applied force of 1 newton moves through a distance of 1 metre in the direction of the force. It is named after the English physicist James Prescott Joule (1818-1889).

Implementation Note:
SI Brochure - Table 4
KATALback to summary
public static final Unit<CatalyticActivity> KATAL

The SI unit for catalytic activity (standard name kat).

Implementation Note:
SI Brochure - Table 4
KELVINback to summary
public static final Unit<Temperature> KELVIN

The kelvin, symbol K, is the SI unit of thermodynamic temperature. It is defined by taking the fixed numerical value of the Boltzmann constant k to be 1.380 649 × 10−²³ when expressed in the unit J K⁻¹, which is equal to kg m² s⁻² K⁻¹, where the kilogram, metre and second are defined in terms of h, c and ∆νCs. This definition implies the exact relation k = 1.380 649 × 10⁻²³ kg m² s⁻² K⁻¹. Inverting this relation gives an exact expression for the kelvin in terms of the defining constants k, h and ∆νCs: 1 K = (1.380 649 / k) × 10⁻²³ kg m² s⁻²

Implementation Note:
SI Base Unit
See Also
JOULE
KILOGRAMback to summary
public static final Unit<Mass> KILOGRAM

The kilogram, symbol kg, is the SI unit of mass. It is defined by taking the fixed numerical value of the Planck constant h to be 6.626 070 15 × 10⁻³⁴ when expressed in the unit J s, which is equal to kg m² s−1, where the metre and the second are defined in terms of c and ∆νCs. This definition implies the exact relation h = 6.626 070 15 × 10−34 kg m² s⁻¹. Inverting this relation gives an exact expression for the kilogram in terms of the three defining constants h, ∆νCs and c: 1 kg = (h / 6.626 070 15 × 10⁻³⁴) m⁻² s

Implementation Note:
SI Base Unit
See Also
Wikipedia: Kilogram, GRAM, METRE, SECOND
KILOMETRE_PER_HOURback to summary
public static final Unit<Speed> KILOMETRE_PER_HOUR

A unit of speed expressing the number of international kilometres per hour (abbreviation km/h).

See Also
Wikipedia: Kilometres per hour
LITREback to summary
public static final Unit<Volume> LITRE

A volume unit accepted for use with SI units (standard name l).

See Also
Wikipedia: Litre
LUMENback to summary
public static final Unit<LuminousFlux> LUMEN

The SI unit for luminous flux (standard name lm). One Lumen is equal to the amount of light given out through a solid angle by a source of one candela intensity radiating equally in all directions.

LUXback to summary
public static final Unit<Illuminance> LUX

The SI unit for illuminance (standard name lx). One Lux is equal to one lumen per square metre.

METREback to summary
public static final Unit<Length> METRE

The metre, symbol m, is the SI unit of length. It is defined by taking the fixed numerical value of the speed of light in vacuum c to be 299 792 458 when expressed in the unit m s⁻¹, where the second is defined in terms of the caesium frequency ∆νCs. This definition implies the exact relation c = 299 792 458 m s⁻¹. Inverting this relation gives an exact expression for the metre in terms of the defining constants c and ∆νCs: 1 m = (c / 299 792 458)s = 9 192 631 770 c / 299 792 458 ∆νCs ≈ 30.663 319 c / ∆νCs

Implementation Note:
SI Base Unit
METRE_PER_SECONDback to summary
public static final Unit<Speed> METRE_PER_SECOND

The SI unit for speed quantities (standard name m/s).

METRE_PER_SQUARE_SECONDback to summary
public static final Unit<Acceleration> METRE_PER_SQUARE_SECOND

The SI unit for acceleration quantities (standard name m/s2).

See Also
Wikipedia: Metre per second squared
MINUTEback to summary
public static final Unit<Time> MINUTE

A time unit accepted for use with SI units (standard name min).

MOLEback to summary
public static final Unit<AmountOfSubstance> MOLE

The mole, symbol mol, is the SI unit of amount of substance. One mole contains exactly 6.022 140 76 × 10²³ elementary entities. This number is the fixed numerical value of the Avogadro constant, NA, when expressed in the unit mol⁻¹ and is called the Avogadro number. The amount of substance, symbol n, of a system is a measure of the number of specified elementary entities. An elementary entity may be an atom, a molecule, an ion, an electron, any other particle or specified group of particles. This definition implies the exact relation Nₐ = 6.022 140 76 × 10²³ mol⁻¹. Inverting this relation gives an exact expression for the mole in terms of the defining constant NA: 1 mol = 6.02214076 × 10²³ / Nₐ

Implementation Note:
SI Base Unit
MONTHback to summary
public static final Unit<Time> MONTH

A unit of duration equal to 1/12 YEAR (common name mo).

Since
2.3
NEWTONback to summary
public static final Unit<Force> NEWTON

The SI unit for force (standard name N). One newton is the force required to give a mass of 1 kilogram an Force of 1 metre per second per second. It is named after the English mathematician and physicist Sir Isaac Newton (1642-1727).

Implementation Note:
SI Brochure - Table 4
OHMback to summary
public static final Unit<ElectricResistance> OHM

The SI unit for electric resistance (standard name Ohm). One Ohm is equal to the resistance of a conductor in which a current of one ampere is produced by a potential of one volt across its terminals. It is named after the German physicist Georg Simon Ohm (1789-1854).

Implementation Note:
SI Brochure - Table 4
PASCALback to summary
public static final Unit<Pressure> PASCAL

The SI unit for pressure, stress (standard name Pa). One pascal is equal to one newton per square meter. It is named after the French philosopher and mathematician Blaise Pascal (1623-1662).

Implementation Note:
SI Brochure - Table 4
Annotations
@SuppressWarnings:unchecked, rawtypes
PERCENTback to summary
public static final Unit<Dimensionless> PERCENT

A dimensionless unit accepted for use with SI units (standard name %).

RADIANback to summary
public static final Unit<Angle> RADIAN

The SI unit for plane angle quantities (standard name rad). One radian is the angle between two radii of a circle such that the length of the arc between them is equal to the radius.

Implementation Note:
SI Brochure - Table 4
SECONDback to summary
public static final Unit<Time> SECOND

The second, symbol s, is the SI unit of time. It is defined by taking the fixed numerical value of the caesium frequency ∆νCs, the unperturbed ground-state hyperfine transition frequency of the caesium 133 atom, to be 9 192 631 770 when expressed in the unit Hz, which is equal to s⁻¹. This definition implies the exact relation ∆νCs = 9 192 631 770 Hz. Inverting this relation gives an expression for the unit second in terms of the defining constant ∆νCs: 1 Hz = ∆νCs / 9 192 631 770 or 1 s = 9 192 631 770 / ∆νCs

Implementation Note:
SI Base Unit
SIEMENSback to summary
public static final Unit<ElectricConductance> SIEMENS

The SI unit for electric conductance (standard name S). One Siemens is equal to one ampere per volt. It is named after the German engineer Ernst Werner von Siemens (1816-1892).

SIEVERTback to summary
public static final Unit<RadiationDoseEffective> SIEVERT

The SI unit for dose equivalent (standard name Sv). One Sievert is equal is equal to the actual dose, in grays, multiplied by a "quality factor" which is larger for more dangerous forms of radiation. It is named after the Swedish physicist Rolf Sievert (1898-1966).

SQUARE_METREback to summary
public static final Unit<Area> SQUARE_METRE

The SI unit for area quantities (standard name m2).

See Also
Wikipedia: Square metre
STERADIANback to summary
public static final Unit<SolidAngle> STERADIAN

The SI unit for solid angle quantities (standard name sr). One steradian is the solid angle subtended at the center of a sphere by an area on the surface of the sphere that is equal to the radius squared. The total solid angle of a sphere is 4*Pi steradians.

Implementation Note:
SI Brochure - Table 4
TESLAback to summary
public static final Unit<MagneticFluxDensity> TESLA

The alternate unit for magnetic flux density (standard name T). One Tesla is equal equal to one weber per square metre. It is named after the Serbian-born American electrical engineer and physicist Nikola Tesla (1856-1943).

VOLTback to summary
public static final Unit<ElectricPotential> VOLT

The SI unit for electric potential difference, electromotive force (standard name V). One Volt is equal to the difference of electric potential between two points on a conducting wire carrying a constant current of one ampere when the power dissipated between the points is one watt. It is named after the Italian physicist Count Alessandro Volta (1745-1827).

Implementation Note:
SI Brochure - Table 4
WATTback to summary
public static final Unit<Power> WATT

The SI unit for power, radiant, flux (standard name W). One watt is equal to one joule per second. It is named after the British scientist James Watt (1736-1819).

Implementation Note:
SI Brochure - Table 4
WEBERback to summary
public static final Unit<MagneticFlux> WEBER

The SI unit for magnetic flux (standard name Wb). One Weber is equal to the magnetic flux that in linking a circuit of one turn produces in it an electromotive force of one volt as it is uniformly reduced to zero within one second. It is named after the German physicist Wilhelm Eduard Weber (1804-1891).

WEEKback to summary
public static final Unit<Time> WEEK

A unit of duration equal to 7 DAY (common name wk).

YEARback to summary
public static final Unit<Time> YEAR

A time unit accepted for use with SI units (standard name yr ).

Constructor Detail

Unitsback to summary
protected Units()

Constructor may only be called by subclasses

Method Detail

addUnitback to summary
protected static <U extends AbstractUnit<?>> U addUnit(final Set<Unit<?>> units, U unit, String name, String symbol)

Adds a new unit not mapped to any specified quantity type to a set with a name and symbol.

Parameters
units:Set<Unit<?>>

the set to add to.

unit:U

the unit being added.

name:String

the string to use as name

symbol:String

the string to use as symbol

Returns:U

unit.

addUnitback to summary
protected static <U extends Unit<?>> U addUnit(final Set<Unit<?>> units, U unit, String name)

Adds a new unit to a set using a name.

Parameters
units:Set<Unit<?>>

the set to add to.

unit:U

the unit being added.

name:String

the string to use as name

Returns:U

unit.

addUnitback to summary
protected static <U extends Unit<?>> U addUnit(final Set<Unit<?>> units, U unit)

Adds a new unit to a set of units.

Parameters
units:Set<Unit<?>>

the set to add to.

unit:U

the unit being added.

Returns:U

unit.

addUnitback to summary
private static <U extends Unit<?>> U addUnit(U unit)

Adds a new unit not mapped to any specified quantity type.

Parameters
unit:U

the unit being added.

Returns:U

unit.

addUnitback to summary
private static <U extends AbstractUnit<?>> U addUnit(U unit, String name, Class<? extends Quantity<?>> type)

Adds a new unit and maps it to the specified quantity type.

Parameters
unit:U

the unit being added.

name:String

the name of the unit being added.

type:Class<? extends Quantity<?>>

the quantity type.

Returns:U

unit.

addUnitback to summary
private static <U extends AbstractUnit<?>> U addUnit(U unit, Class<? extends Quantity<?>> type)

Adds a new unit and maps it to the specified quantity type.

Parameters
unit:U

the unit being added.

type:Class<? extends Quantity<?>>

the quantity type.

Returns:U

unit.

getInstanceback to summary
public static Units getInstance()

Returns the unique instance of this class.

Returns:Units

the Units instance.

getNameback to summary
public String getName()

Implements abstract tech.units.indriya.AbstractSystemOfUnits.getName.

Implements javax.measure.spi.SystemOfUnits.getName, tech.uom.lib.common.function.Nameable.getName.

Returns:String

Doc from javax.measure.spi.SystemOfUnits.getName.

a name

Annotations
@Override