Enum Class PressureUnit

java.lang.Object
java.lang.Enum<PressureUnit>
org.ka2ddo.util.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
  • Enum Constant Details

    • Pa

      public static final PressureUnit Pa
      Pressure in pascals.
    • HPa

      public static final PressureUnit HPa
      Pressure in hectopascals (also known as millibars).
    • KPa

      public static final PressureUnit KPa
      Pressure in kilopascals (also known as 10's of millibars).
    • mmHg

      public static final PressureUnit mmHg
      Pressure in millimeters of mercury.
    • PSI

      public static final PressureUnit PSI
      Pressure in pounds per square inch.
    • inHg

      public static final PressureUnit inHg
      Pressure in inches of mercury.
  • Method Details

    • values

      public static PressureUnit[] 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 PressureUnit 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
    • from

      public final float from(PressureUnit other)
      Get the multiplicative conversion factor to convert a pressure from the specified units to this unit.
      Specified by:
      from in interface UnitEnum<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

      public float getOffset(PressureUnit other)
      Get the additive offset to convert a value from the specified unit to this unit.
      Specified by:
      getOffset in interface UnitEnum<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

      public final String unitString()
      Get the string to use when displaying values of this unit.
      Returns:
      suffix display String
    • getImagePath

      public String getImagePath()
      Return the relative path name of the image file for this enum value.
      Specified by:
      getImagePath in interface EnumWithImageName
      Returns:
      path name String