Package tech.units.indriya.unit
Class Units
- java.lang.Object
-
- tech.units.indriya.AbstractSystemOfUnits
-
- tech.units.indriya.unit.Units
-
- All Implemented Interfaces:
javax.measure.spi.SystemOfUnits
,tech.uom.lib.common.function.Nameable
public class Units extends AbstractSystemOfUnits implements tech.uom.lib.common.function.Nameable
This class defines commonly used units.
- Since:
- 1.0
- Version:
- 1.1, April 22, 2018
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class tech.units.indriya.AbstractSystemOfUnits
AbstractSystemOfUnits.Helper
-
-
Field Summary
Fields Modifier and Type Field Description static javax.measure.Unit<javax.measure.quantity.ElectricCurrent>
AMPERE
The SI base unit for electric current quantities (standard nameA
).static javax.measure.Unit<javax.measure.quantity.Radioactivity>
BECQUEREL
The SI unit for activity of a radionuclide (standard nameBq
).static javax.measure.Unit<javax.measure.quantity.LuminousIntensity>
CANDELA
The SI base unit for luminous intensity quantities (standard namecd
).static AbstractUnit<javax.measure.quantity.Temperature>
CELSIUS
The SI unit for Celsius temperature (standard nameCel
).static javax.measure.Unit<javax.measure.quantity.ElectricCharge>
COULOMB
The SI unit for electric charge, quantity of electricity (standard nameC
).static javax.measure.Unit<javax.measure.quantity.Volume>
CUBIC_METRE
The SI unit for volume quantities (standard namem3
).static javax.measure.Unit<javax.measure.quantity.Time>
DAY
A time unit accepted for use with SI units (standard named
).static javax.measure.Unit<javax.measure.quantity.ElectricCapacitance>
FARAD
The SI unit for capacitance (standard nameF
).static javax.measure.Unit<javax.measure.quantity.Mass>
GRAM
The SI derived unit for mass quantities (standard nameg
).static javax.measure.Unit<javax.measure.quantity.RadiationDoseAbsorbed>
GRAY
The SI unit for absorbed dose, specific energy (imparted), kerma (standard nameGy
).static javax.measure.Unit<javax.measure.quantity.ElectricInductance>
HENRY
The alternate unit for inductance (standard nameH
).static javax.measure.Unit<javax.measure.quantity.Frequency>
HERTZ
The SI unit for frequency (standard nameHz
).static javax.measure.Unit<javax.measure.quantity.Time>
HOUR
A time unit accepted for use with SI units (standard nameh
).private static Units
INSTANCE
static javax.measure.Unit<javax.measure.quantity.Energy>
JOULE
The SI unit for energy, work, quantity of heat (J
).static javax.measure.Unit<javax.measure.quantity.CatalyticActivity>
KATAL
The SI unit for catalytic activity (standard namekat
).static javax.measure.Unit<javax.measure.quantity.Temperature>
KELVIN
The SI base unit for thermodynamic temperature quantities (standard nameK
).static AbstractUnit<javax.measure.quantity.Mass>
KILOGRAM
The SI base unit for mass quantities (standard namekg
).static javax.measure.Unit<javax.measure.quantity.Speed>
KILOMETRE_PER_HOUR
static javax.measure.Unit<javax.measure.quantity.Volume>
LITRE
A volume unit accepted for use with SI units (standard namel
).static javax.measure.Unit<javax.measure.quantity.LuminousFlux>
LUMEN
The SI unit for luminous flux (standard namelm
).static javax.measure.Unit<javax.measure.quantity.Illuminance>
LUX
The SI unit for illuminance (standard namelx
).static javax.measure.Unit<javax.measure.quantity.Length>
METRE
The SI base unit for length quantities (standard namem
).static javax.measure.Unit<javax.measure.quantity.Speed>
METRE_PER_SECOND
The SI unit for velocity quantities (standard namem/s
).static javax.measure.Unit<javax.measure.quantity.Acceleration>
METRE_PER_SQUARE_SECOND
The SI unit for acceleration quantities (standard namem/s2
).static javax.measure.Unit<javax.measure.quantity.Time>
MINUTE
A time unit accepted for use with SI units (standard namemin
).static javax.measure.Unit<javax.measure.quantity.AmountOfSubstance>
MOLE
The SI base unit for amount of substance quantities (standard namemol
).static javax.measure.Unit<javax.measure.quantity.Force>
NEWTON
The SI unit for force (standard nameN
).static AbstractUnit<javax.measure.quantity.ElectricResistance>
OHM
The SI unit for electric resistance (standard nameOhm
).static javax.measure.Unit<javax.measure.quantity.Pressure>
PASCAL
The SI unit for pressure, stress (standard namePa
).static javax.measure.Unit<javax.measure.quantity.Dimensionless>
PERCENT
A dimensionless unit accepted for use with SI units (standard name%
).static javax.measure.Unit<javax.measure.quantity.Angle>
RADIAN
The SI unit for plane angle quantities (standard namerad
).static javax.measure.Unit<javax.measure.quantity.Time>
SECOND
The SI base unit for duration quantities (standard names
).static javax.measure.Unit<javax.measure.quantity.ElectricConductance>
SIEMENS
The SI unit for electric conductance (standard nameS
).static javax.measure.Unit<javax.measure.quantity.RadiationDoseEffective>
SIEVERT
The SI unit for dose equivalent (standard nameSv
).static javax.measure.Unit<javax.measure.quantity.Area>
SQUARE_METRE
The SI unit for area quantities (standard namem2
).static javax.measure.Unit<javax.measure.quantity.SolidAngle>
STERADIAN
The SI unit for solid angle quantities (standard namesr
).static javax.measure.Unit<javax.measure.quantity.MagneticFluxDensity>
TESLA
The alternate unit for magnetic flux density (standard nameT
).static javax.measure.Unit<javax.measure.quantity.ElectricPotential>
VOLT
The SI unit for electric potential difference, electromotive force (standard nameV
).static javax.measure.Unit<javax.measure.quantity.Power>
WATT
The SI unit for power, radiant, flux (standard nameW
).static javax.measure.Unit<javax.measure.quantity.MagneticFlux>
WEBER
The SI unit for magnetic flux (standard nameWb
).static javax.measure.Unit<javax.measure.quantity.Time>
WEEK
A unit of duration equal to 7DAY
(standard nameweek
).static javax.measure.Unit<javax.measure.quantity.Time>
YEAR
A time unit accepted for use with SI units (standard namey
).-
Fields inherited from class tech.units.indriya.AbstractSystemOfUnits
E, logger, quantityToUnit, units
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Units()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static <U extends javax.measure.Unit<?>>
UaddUnit(U unit)
Adds a new unit not mapped to any specified quantity type.private static <U extends AbstractUnit<?>>
UaddUnit(U unit, java.lang.Class<? extends javax.measure.Quantity<?>> type)
Adds a new unit and maps it to the specified quantity type.static javax.measure.spi.SystemOfUnits
getInstance()
Returns the unique instance of this class.java.lang.String
getName()
-
Methods inherited from class tech.units.indriya.AbstractSystemOfUnits
getUnit, getUnits, getUnits
-
-
-
-
Field Detail
-
INSTANCE
private static final Units INSTANCE
-
AMPERE
public static final javax.measure.Unit<javax.measure.quantity.ElectricCurrent> AMPERE
The SI base unit for electric current quantities (standard nameA
). The Ampere is that constant current which, if maintained in two straight parallel conductors of infinite length, of negligible circular cross-section, and placed 1 meter apart in vacuum, would produce between these conductors a force equal to 2 * 10-7 newton per meter of length. It is named after the French physicist Andre Ampere (1775-1836).
-
CANDELA
public static final javax.measure.Unit<javax.measure.quantity.LuminousIntensity> CANDELA
The SI base unit for luminous intensity quantities (standard namecd
). The candela is the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540 * 1012 hertz and that has a radiant intensity in that direction of 1/683 watt per steradian- See Also:
- Wikipedia: Candela
-
KELVIN
public static final javax.measure.Unit<javax.measure.quantity.Temperature> KELVIN
The SI base unit for thermodynamic temperature quantities (standard nameK
). The kelvin is the 1/273.16th of the thermodynamic temperature of the triple point of water. It is named after the Scottish mathematician and physicist William Thomson 1st Lord Kelvin (1824-1907)
-
KILOGRAM
public static final AbstractUnit<javax.measure.quantity.Mass> KILOGRAM
The SI base unit for mass quantities (standard namekg
). It is the only SI unit with a prefix as part of its name and symbol. The kilogram is equal to the mass of an international prototype in the form of a platinum-iridium cylinder kept at Sevres in France.- See Also:
GRAM
-
METRE
public static final javax.measure.Unit<javax.measure.quantity.Length> METRE
The SI base unit for length quantities (standard namem
). One metre was redefined in 1983 as the distance traveled by light in a vacuum in 1/299,792,458 of a second.
-
MOLE
public static final javax.measure.Unit<javax.measure.quantity.AmountOfSubstance> MOLE
The SI base unit for amount of substance quantities (standard namemol
). The mole is the amount of substance of a system which contains as many elementary entities as there are atoms in 0.012 kilogram of carbon 12.
-
SECOND
public static final javax.measure.Unit<javax.measure.quantity.Time> SECOND
The SI base unit for duration quantities (standard names
). It is defined as the duration of 9,192,631,770 cycles of radiation corresponding to the transition between two hyperfine levels of the ground state of cesium (1967 Standard).
-
GRAM
public static final javax.measure.Unit<javax.measure.quantity.Mass> GRAM
The SI derived unit for mass quantities (standard nameg
). The base unit for mass quantity isKILOGRAM
.
-
RADIAN
public static final javax.measure.Unit<javax.measure.quantity.Angle> RADIAN
The SI unit for plane angle quantities (standard namerad
). 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.
-
STERADIAN
public static final javax.measure.Unit<javax.measure.quantity.SolidAngle> STERADIAN
The SI unit for solid angle quantities (standard namesr
). 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.
-
HERTZ
public static final javax.measure.Unit<javax.measure.quantity.Frequency> HERTZ
The SI unit for frequency (standard nameHz
). 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.
-
NEWTON
public static final javax.measure.Unit<javax.measure.quantity.Force> NEWTON
The SI unit for force (standard nameN
). 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).
-
PASCAL
public static final javax.measure.Unit<javax.measure.quantity.Pressure> PASCAL
The SI unit for pressure, stress (standard namePa
). One pascal is equal to one newton per square meter. It is named after the French philosopher and mathematician Blaise Pascal (1623-1662).
-
JOULE
public static final javax.measure.Unit<javax.measure.quantity.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).
-
WATT
public static final javax.measure.Unit<javax.measure.quantity.Power> WATT
The SI unit for power, radiant, flux (standard nameW
). One watt is equal to one joule per second. It is named after the British scientist James Watt (1736-1819).
-
COULOMB
public static final javax.measure.Unit<javax.measure.quantity.ElectricCharge> COULOMB
The SI unit for electric charge, quantity of electricity (standard nameC
). 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).
-
VOLT
public static final javax.measure.Unit<javax.measure.quantity.ElectricPotential> VOLT
The SI unit for electric potential difference, electromotive force (standard nameV
). 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).
-
FARAD
public static final javax.measure.Unit<javax.measure.quantity.ElectricCapacitance> FARAD
The SI unit for capacitance (standard nameF
). 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).
-
OHM
public static final AbstractUnit<javax.measure.quantity.ElectricResistance> OHM
The SI unit for electric resistance (standard nameOhm
). 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).
-
SIEMENS
public static final javax.measure.Unit<javax.measure.quantity.ElectricConductance> SIEMENS
The SI unit for electric conductance (standard nameS
). One Siemens is equal to one ampere per volt. It is named after the German engineer Ernst Werner von Siemens (1816-1892).
-
WEBER
public static final javax.measure.Unit<javax.measure.quantity.MagneticFlux> WEBER
The SI unit for magnetic flux (standard nameWb
). 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).
-
TESLA
public static final javax.measure.Unit<javax.measure.quantity.MagneticFluxDensity> TESLA
The alternate unit for magnetic flux density (standard nameT
). 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).
-
HENRY
public static final javax.measure.Unit<javax.measure.quantity.ElectricInductance> HENRY
The alternate unit for inductance (standard nameH
). 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).
-
CELSIUS
public static final AbstractUnit<javax.measure.quantity.Temperature> CELSIUS
The SI unit for Celsius temperature (standard nameCel
). This is a unit of temperature such as the freezing point of water (at one atmosphere of pressure) is 0 Cel, while the boiling point is 100 Cel.
-
LUMEN
public static final javax.measure.Unit<javax.measure.quantity.LuminousFlux> LUMEN
The SI unit for luminous flux (standard namelm
). 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.
-
LUX
public static final javax.measure.Unit<javax.measure.quantity.Illuminance> LUX
The SI unit for illuminance (standard namelx
). One Lux is equal to one lumen per square metre.
-
BECQUEREL
public static final javax.measure.Unit<javax.measure.quantity.Radioactivity> BECQUEREL
The SI unit for activity of a radionuclide (standard nameBq
). One becquerel is the radiation caused by one disintegration per second. It is named after the French physicist, Antoine-Henri Becquerel (1852-1908).
-
GRAY
public static final javax.measure.Unit<javax.measure.quantity.RadiationDoseAbsorbed> GRAY
The SI unit for absorbed dose, specific energy (imparted), kerma (standard nameGy
). 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).
-
SIEVERT
public static final javax.measure.Unit<javax.measure.quantity.RadiationDoseEffective> SIEVERT
The SI unit for dose equivalent (standard nameSv
). 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).
-
KATAL
public static final javax.measure.Unit<javax.measure.quantity.CatalyticActivity> KATAL
The SI unit for catalytic activity (standard namekat
).
-
METRE_PER_SECOND
public static final javax.measure.Unit<javax.measure.quantity.Speed> METRE_PER_SECOND
The SI unit for velocity quantities (standard namem/s
).
-
METRE_PER_SQUARE_SECOND
public static final javax.measure.Unit<javax.measure.quantity.Acceleration> METRE_PER_SQUARE_SECOND
The SI unit for acceleration quantities (standard namem/s2
).
-
SQUARE_METRE
public static final javax.measure.Unit<javax.measure.quantity.Area> SQUARE_METRE
The SI unit for area quantities (standard namem2
).
-
CUBIC_METRE
public static final javax.measure.Unit<javax.measure.quantity.Volume> CUBIC_METRE
The SI unit for volume quantities (standard namem3
).
-
KILOMETRE_PER_HOUR
public static final javax.measure.Unit<javax.measure.quantity.Speed> KILOMETRE_PER_HOUR
-
PERCENT
public static final javax.measure.Unit<javax.measure.quantity.Dimensionless> PERCENT
A dimensionless unit accepted for use with SI units (standard name%
).
-
MINUTE
public static final javax.measure.Unit<javax.measure.quantity.Time> MINUTE
A time unit accepted for use with SI units (standard namemin
).
-
HOUR
public static final javax.measure.Unit<javax.measure.quantity.Time> HOUR
A time unit accepted for use with SI units (standard nameh
).
-
DAY
public static final javax.measure.Unit<javax.measure.quantity.Time> DAY
A time unit accepted for use with SI units (standard named
).
-
WEEK
public static final javax.measure.Unit<javax.measure.quantity.Time> WEEK
A unit of duration equal to 7DAY
(standard nameweek
).
-
YEAR
public static final javax.measure.Unit<javax.measure.quantity.Time> YEAR
A time unit accepted for use with SI units (standard namey
).
-
LITRE
public static final javax.measure.Unit<javax.measure.quantity.Volume> LITRE
A volume unit accepted for use with SI units (standard namel
).- See Also:
- Wikipedia: Litre
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfacetech.uom.lib.common.function.Nameable
- Specified by:
getName
in interfacejavax.measure.spi.SystemOfUnits
- Specified by:
getName
in classAbstractSystemOfUnits
-
getInstance
public static javax.measure.spi.SystemOfUnits getInstance()
Returns the unique instance of this class.- Returns:
- the Units instance.
-
addUnit
private static <U extends javax.measure.Unit<?>> U addUnit(U unit)
Adds a new unit not mapped to any specified quantity type.- Parameters:
unit
- the unit being added.- Returns:
unit
.
-
addUnit
private static <U extends AbstractUnit<?>> U addUnit(U unit, java.lang.Class<? extends javax.measure.Quantity<?>> type)
Adds a new unit and maps it to the specified quantity type.- Parameters:
unit
- the unit being added.type
- the quantity type.- Returns:
unit
.
-
-