Package org.ka2ddo.util
Enum Class PressureUnit
- All Implemented Interfaces:
Serializable
,Comparable<PressureUnit>
,Constable
,EnumWithImageName
,UnitEnum<PressureUnit>
public enum PressureUnit
extends Enum<PressureUnit>
implements EnumWithImageName, UnitEnum<PressureUnit>
Enumeration of supported units of atmospheric pressure. All scaling factors are in units
relative to the Peet Bros weather station standard resolution of 0.1 millibars.
- Author:
- Andrew Pavlin, KA2DDO
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal float
from
(PressureUnit other) Get the multiplicative conversion factor to convert a pressure from the specified units to this unit.final int
Get the number of digits after the decimal point for displaying in these units.Return the relative path name of the image file for this enum value.float
getOffset
(PressureUnit other) Get the additive offset to convert a value from the specified unit to this unit.final String
Get the string to use when displaying values of this unit.static PressureUnit
Returns the enum constant of this class with the specified name.static PressureUnit[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Pa
Pressure in pascals. -
HPa
Pressure in hectopascals (also known as millibars). -
KPa
Pressure in kilopascals (also known as 10's of millibars). -
mmHg
Pressure in millimeters of mercury. -
PSI
Pressure in pounds per square inch. -
inHg
Pressure in inches of mercury.
-
-
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
-
from
Get the multiplicative conversion factor to convert a pressure from the specified units to this unit.- Specified by:
from
in interfaceUnitEnum<PressureUnit>
- Parameters:
other
- another PressureUnit representing the existing units of a pressure value- Returns:
- the conversion factor to change a pressure value into this unit
-
getOffset
Get the additive offset to convert a value from the specified unit to this unit.- Specified by:
getOffset
in interfaceUnitEnum<PressureUnit>
- Parameters:
other
- another PressureUnit representing the existing units of a value- Returns:
- the offset (after multiplying by the from() factor) to add to get the value in this unit
-
getDigitsAfterDecimalPoint
public final int getDigitsAfterDecimalPoint()Get the number of digits after the decimal point for displaying in these units.- Returns:
- digits to display after decimal point
-
unitString
Get the string to use when displaying values of this unit.- Returns:
- suffix display String
-
getImagePath
Return the relative path name of the image file for this enum value.- Specified by:
getImagePath
in interfaceEnumWithImageName
- Returns:
- path name String
-