Enum Class Pressure

java.lang.Object
java.lang.Enum<Pressure>
org.tquadrat.foundation.value.Pressure
All Implemented Interfaces:
Serializable, Comparable<Pressure>, Constable, Dimension, DimensionWithLinearConversion

@ClassVersion(sourceVersion="$Id: Pressure.java 1072 2023-09-30 20:44:38Z tquadrat $") @API(status=STABLE, since="0.1.0") public enum Pressure extends Enum<Pressure> implements DimensionWithLinearConversion
The various instances of pressure.
Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: Pressure.java 1072 2023-09-30 20:44:38Z tquadrat $
Since:
0.1.0
UML Diagram
UML Diagram for "org.tquadrat.foundation.value.Pressure"

UML Diagram for "org.tquadrat.foundation.value.Pressure"

UML Diagram for "org.tquadrat.foundation.value.Pressure"
  • Enum Constant Details

  • Field Details

  • Constructor Details

    • Pressure

      private Pressure(BigDecimal factor, String unitSymbol)
      Creates a new Pressure instance.
      Parameters:
      factor - The factor.
      unitSymbol - The unit string.
  • Method Details

    • values

      public static Pressure[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Pressure valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • baseUnit

      public final Pressure baseUnit()

      Returns the base unit.

      E.g. for length, the base unit would be Meter (m), for mass, it is Kilogram (kg), and so on.

      Specified by:
      baseUnit in interface Dimension
      Returns:
      The base unit.
    • factor

      public final BigDecimal factor()

      Returns the factor that is used to convert a value from this unit to the base unit.

      For length, if you have to convert a Centimeter value to Meter, you will divide that by 100 or multiply it with a factor of 0.01.

      For the base unit, the factor is 1.0.

      Specified by:
      factor in interface DimensionWithLinearConversion
      Returns:
      The factor.
      See Also:
    • forUnit

      public static final Pressure forUnit(String unitSymbol) throws IllegalArgumentException
      Returns the Pressure instance for the given unit.
      Parameters:
      unitSymbol - The unit symbol.
      Returns:
      The respective instance.
      Throws:
      IllegalArgumentException - The given unit is unknown.
    • unitSymbol

      public final String unitSymbol()

      Returns the unit symbol for the dimension as a single line string.

      For a length, this would be "m", for a speed "km/h", and for an acceleration, it could be "m/(s^2)".

      Specified by:
      unitSymbol in interface Dimension
      Returns:
      The unit.