Package org.djunits.quantity
Class Energy.Unit
- All Implemented Interfaces:
UnitInterface<Energy.Unit,Energy>
- Enclosing class:
- Energy
Energy.Unit encodes the units of energy.
Copyright (c) 2025-2026 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djunits.org. The DJUNITS project is distributed under a three-clause BSD-style license.
- Author:
- Alexander Verbraeck
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Energy.UnitBritish thermal unit (ISO).static final Energy.UnitBritish thermal unit (International Table).static final Energy.Unitcalorie.static final Energy.Unitcalorie (International Table).static final Energy.Uniterg (cgs).static final Energy.Unitelectronvolt.static final Energy.Unitfoot-pound force.static final Energy.Unitgiga-electronvolt.static final Energy.Unitgigajoule.static final Energy.Unitgigawatt hour.static final Energy.Unitinch-pound force.static final Energy.UnitJoule.static final Energy.Unitkilocalorie.static final Energy.Unitkilo-electronvolt.static final Energy.Unitkilojoule.static final Energy.Unitkilowatt hour.static final Energy.Unitmega-electronvolt.static final Energy.Unitmillijoule.static final Energy.Unitmegajoule.static final Energy.Unitmicrojoule.static final Energy.Unitmicrowatt hour.static final Energy.Unitmilliwatt hour.static final Energy.Unitmegawatt hour.static final Energy.Unitpetajoule.static final Energy.Unitpetawatt hour.static final Energy.UnitThe SI or BASE unit.static final SIUnitThe dimensions of energy: kgm2/s2.static final Energy.Unitsthene-meter (mts).static final Energy.Unitterajoule.static final Energy.Unitterawatt hour.static final Energy.Unitwatt hour. -
Constructor Summary
ConstructorsConstructorDescriptionUnit(String id, String name, double scaleFactorToBaseUnit, UnitSystem unitSystem) Create a new Energy unit.Unit(String textualAbbreviation, String displayAbbreviation, String name, Scale scale, UnitSystem unitSystem) Return a derived unit for this unit, with textual abbreviation(s) and a display abbreviation. -
Method Summary
Modifier and TypeMethodDescriptionderiveUnit(String textualAbbreviation, String displayAbbreviation, String name, double scaleFactor, UnitSystem unitSystem) Return a linearly scaled derived unit for this unit, with textual abbreviation(s) and a display abbreviation.Return the base unit for this unit.ofSi(double si) Return an SI-quantity for this unit with a value.siUnit()Return the SI unit for this unit.Methods inherited from class org.djunits.unit.AbstractUnit
deriveUnit, equals, generateSiPrefixes, getDisplayAbbreviation, getId, getName, getScale, getSiPrefix, getStoredDisplayAbbreviation, getStoredName, getStoredTextualAbbreviation, getTextualAbbreviation, getUnitSystem, hashCode, setSiPrefix, setSiPrefix, setSiPrefixKilo, setSiPrefixPer, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djunits.unit.UnitInterface
fromBaseValue, quantityInUnit, toBaseValue
-
Field Details
-
SI_UNIT
The dimensions of energy: kgm2/s2. -
J
Joule. -
SI
The SI or BASE unit. -
muJ
microjoule. -
mJ
millijoule. -
kJ
kilojoule. -
MJ
megajoule. -
GJ
gigajoule. -
TJ
terajoule. -
PJ
petajoule. -
ft_lbf
foot-pound force. -
in_lbf
inch-pound force. -
BTU_ISO
British thermal unit (ISO). -
BTU_IT
British thermal unit (International Table). -
cal_IT
calorie (International Table). -
cal
calorie. -
kcal
kilocalorie. -
WATT_HOUR
watt hour. -
muWh
microwatt hour. -
mWh
milliwatt hour. -
kWh
kilowatt hour. -
MWh
megawatt hour. -
GWh
gigawatt hour. -
TWh
terawatt hour. -
PWh
petawatt hour. -
eV
electronvolt. -
keV
kilo-electronvolt. -
MeV
mega-electronvolt. -
GeV
giga-electronvolt. -
sn_m
sthene-meter (mts). -
erg
erg (cgs).
-
-
Constructor Details
-
Unit
Create a new Energy unit.- Parameters:
id- the id or main abbreviation of the unitname- the full name of the unitscaleFactorToBaseUnit- the scale factor of the unit to convert it TO the base (SI) unitunitSystem- the unit system such as SI or IMPERIAL
-
Unit
public Unit(String textualAbbreviation, String displayAbbreviation, String name, Scale scale, UnitSystem unitSystem) Return a derived unit for this unit, with textual abbreviation(s) and a display abbreviation.- Parameters:
textualAbbreviation- the textual abbreviation of the unit, which doubles as the iddisplayAbbreviation- the display abbreviation of the unitname- the full name of the unitscale- the scale to use to convert between this unit and the standard (e.g., SI, BASE) unitunitSystem- unit system, e.g. SI or Imperial
-
-
Method Details
-
siUnit
Description copied from interface:UnitInterfaceReturn the SI unit for this unit.- Returns:
- the SI unit for this unit
-
getBaseUnit
Description copied from interface:UnitInterfaceReturn the base unit for this unit.- Returns:
- the base unit for this unit
-
ofSi
Description copied from interface:UnitInterfaceReturn an SI-quantity for this unit with a value.- Parameters:
si- the value in SI or BASE units- Returns:
- an SI-quantity for this unit with the given si-value
-
deriveUnit
public Energy.Unit deriveUnit(String textualAbbreviation, String displayAbbreviation, String name, double scaleFactor, UnitSystem unitSystem) Description copied from class:AbstractUnitReturn a linearly scaled derived unit for this unit, with textual abbreviation(s) and a display abbreviation.- Specified by:
deriveUnitin classAbstractUnit<Energy.Unit,Energy> - Parameters:
textualAbbreviation- the textual abbreviation of the unit, which doubles as the iddisplayAbbreviation- the display abbreviation of the unitname- the full name of the unitscaleFactor- the (linear) scale factor to multiply with the current (linear) scale factorunitSystem- unit system, e.g. SI or Imperial- Returns:
- a derived unit for this unit
-