Class Energy.Unit

All Implemented Interfaces:
UnitInterface<Energy.Unit,Energy>
Enclosing class:
Energy

public static class Energy.Unit extends AbstractUnit<Energy.Unit,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 Details

    • SI_UNIT

      public static final SIUnit SI_UNIT
      The dimensions of energy: kgm2/s2.
    • J

      public static final Energy.Unit J
      Joule.
    • SI

      public static final Energy.Unit SI
      The SI or BASE unit.
    • muJ

      public static final Energy.Unit muJ
      microjoule.
    • mJ

      public static final Energy.Unit mJ
      millijoule.
    • kJ

      public static final Energy.Unit kJ
      kilojoule.
    • MJ

      public static final Energy.Unit MJ
      megajoule.
    • GJ

      public static final Energy.Unit GJ
      gigajoule.
    • TJ

      public static final Energy.Unit TJ
      terajoule.
    • PJ

      public static final Energy.Unit PJ
      petajoule.
    • ft_lbf

      public static final Energy.Unit ft_lbf
      foot-pound force.
    • in_lbf

      public static final Energy.Unit in_lbf
      inch-pound force.
    • BTU_ISO

      public static final Energy.Unit BTU_ISO
      British thermal unit (ISO).
    • BTU_IT

      public static final Energy.Unit BTU_IT
      British thermal unit (International Table).
    • cal_IT

      public static final Energy.Unit cal_IT
      calorie (International Table).
    • cal

      public static final Energy.Unit cal
      calorie.
    • kcal

      public static final Energy.Unit kcal
      kilocalorie.
    • WATT_HOUR

      public static final Energy.Unit WATT_HOUR
      watt hour.
    • muWh

      public static final Energy.Unit muWh
      microwatt hour.
    • mWh

      public static final Energy.Unit mWh
      milliwatt hour.
    • kWh

      public static final Energy.Unit kWh
      kilowatt hour.
    • MWh

      public static final Energy.Unit MWh
      megawatt hour.
    • GWh

      public static final Energy.Unit GWh
      gigawatt hour.
    • TWh

      public static final Energy.Unit TWh
      terawatt hour.
    • PWh

      public static final Energy.Unit PWh
      petawatt hour.
    • eV

      public static final Energy.Unit eV
      electronvolt.
    • keV

      public static final Energy.Unit keV
      kilo-electronvolt.
    • MeV

      public static final Energy.Unit MeV
      mega-electronvolt.
    • GeV

      public static final Energy.Unit GeV
      giga-electronvolt.
    • sn_m

      public static final Energy.Unit sn_m
      sthene-meter (mts).
    • erg

      public static final Energy.Unit erg
      erg (cgs).
  • Constructor Details

    • Unit

      public Unit(String id, String name, double scaleFactorToBaseUnit, UnitSystem unitSystem)
      Create a new Energy unit.
      Parameters:
      id - the id or main abbreviation of the unit
      name - the full name of the unit
      scaleFactorToBaseUnit - the scale factor of the unit to convert it TO the base (SI) unit
      unitSystem - 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 id
      displayAbbreviation - the display abbreviation of the unit
      name - the full name of the unit
      scale - the scale to use to convert between this unit and the standard (e.g., SI, BASE) unit
      unitSystem - unit system, e.g. SI or Imperial
  • Method Details

    • siUnit

      public SIUnit siUnit()
      Description copied from interface: UnitInterface
      Return the SI unit for this unit.
      Returns:
      the SI unit for this unit
    • getBaseUnit

      public Energy.Unit getBaseUnit()
      Description copied from interface: UnitInterface
      Return the base unit for this unit.
      Returns:
      the base unit for this unit
    • ofSi

      public Energy ofSi(double si)
      Description copied from interface: UnitInterface
      Return 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: AbstractUnit
      Return a linearly scaled derived unit for this unit, with textual abbreviation(s) and a display abbreviation.
      Specified by:
      deriveUnit in class AbstractUnit<Energy.Unit,Energy>
      Parameters:
      textualAbbreviation - the textual abbreviation of the unit, which doubles as the id
      displayAbbreviation - the display abbreviation of the unit
      name - the full name of the unit
      scaleFactor - the (linear) scale factor to multiply with the current (linear) scale factor
      unitSystem - unit system, e.g. SI or Imperial
      Returns:
      a derived unit for this unit