- 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"
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA technical atmosphere (at).A physical atmosphere (atm).A bar.A hekto Pascal.An inch of Mercury.A kilo Pascal.A mega Pascal.A milli bar; same asHEKTO_PASCAL
.A milli Pascal.A mm of Mercury; same asTORR
.Same asPASCAL
, but a different unit.Same asMEGA_PASCAL
, but a different unit.One Pascal.A psi.A Torr. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BigDecimal
The factor.private final String
The unit string.Fields inherited from interface org.tquadrat.foundation.value.api.DimensionWithLinearConversion
MSG_UnknownUnit
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Pressure
(BigDecimal factor, String unitSymbol) Creates a newPressure
instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal Pressure
baseUnit()
Returns the base unit.final BigDecimal
factor()
Returns the factor that is used to convert a value from this unit to the base unit.static final Pressure
Returns thePressure
instance for the given unit.final String
Returns the unit symbol for the dimension as a single line string.static Pressure
Returns the enum constant of this class with the specified name.static Pressure[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface org.tquadrat.foundation.value.api.Dimension
equals, getPrecision, name, toString, unitSymbolForPrinting
Methods inherited from interface org.tquadrat.foundation.value.api.DimensionWithLinearConversion
fromBase, toBase
-
Enum Constant Details
-
MILLI_PASCAL
A milli Pascal. -
PASCAL
One Pascal. -
NEWTON_PER_SQUAREMETER
Same asPASCAL
, but a different unit. -
HEKTO_PASCAL
A hekto Pascal. -
MILLI_BAR
A milli bar; same asHEKTO_PASCAL
. -
TORR
A Torr. -
MILLIMETER_OF_MERCURY
A mm of Mercury; same asTORR
. -
INCH_OF_MERCURY
An inch of Mercury. -
KILO_PASCAL
A kilo Pascal. -
PSI
A psi. -
AT
A technical atmosphere (at). -
BAR
A bar. -
ATM
A physical atmosphere (atm). -
MEGA_PASCAL
A mega Pascal. -
NEWTON_PER_SQUAREMILLIMETER
Same asMEGA_PASCAL
, but a different unit.
-
-
Field Details
-
m_Factor
The factor. -
m_UnitSymbol
The unit string.
-
-
Constructor Details
-
Pressure
Creates a newPressure
instance.- Parameters:
factor
- The factor.unitSymbol
- The unit string.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
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.
-
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 interfaceDimensionWithLinearConversion
- Returns:
- The factor.
- See Also:
-
forUnit
Returns thePressure
instance for the given unit.- Parameters:
unitSymbol
- The unit symbol.- Returns:
- The respective instance.
- Throws:
IllegalArgumentException
- The given unit is unknown.
-
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 interfaceDimension
- Returns:
- The unit.
-