Package com.iizix

Enum Class TemperatureUnit

All Implemented Interfaces:
Serializable, Comparable<TemperatureUnit>, Constable

public enum TemperatureUnit extends Enum<TemperatureUnit>
Enum for temperature types.
  • Nested Class Summary Link icon

    Nested classes/interfaces inherited from class java.lang.Enum Link icon

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary Link icon

    Enum Constants
    Enum Constant
    Description
    Celcius formatted as "°C".
    Fahrenheit formatted as "°F".
    Kelvin "°K".
    Rankine "°R".
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    final String
    Suffix for temperature value.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    abstract double
    toCelcius(double temperature)
    Converts the temperature of the current temperature unit to Celcius.
    abstract float
    toCelcius(float temperature)
    Converts the temperature of the current temperature unit to Celcius.
    abstract double
    toFahrenheit(double temperature)
    Converts the temperature of the current temperature unit to Fahrenheit.
    abstract float
    toFahrenheit(float temperature)
    Converts the temperature of the current temperature unit to Fahrenheit.
    abstract double
    toKelvin(double temperature)
    Converts the temperature of the current temperature unit to Kelvin.
    abstract float
    toKelvin(float temperature)
    Converts the temperature of the current temperature unit to Kelvin.
    abstract double
    toRankine(double temperature)
    Converts the temperature of the current temperature unit to Rankine.
    abstract float
    toRankine(float temperature)
    Converts the temperature of the current temperature unit to Rankine.
    double
    toType(double temperature, TemperatureUnit unit)
    Converts the temperature of the current temperature unit to the requested temperature unit type.
    float
    toType(float temperature, TemperatureUnit unit)
    Converts the temperature of the current temperature unit to the requested temperature unit type.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object Link icon

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details Link icon

    • CELCIUS Link icon

      public static final TemperatureUnit CELCIUS
      Celcius formatted as "°C".
    • FAHRENHEIT Link icon

      public static final TemperatureUnit FAHRENHEIT
      Fahrenheit formatted as "°F".
    • KELVIN Link icon

      public static final TemperatureUnit KELVIN
      Kelvin "°K".
    • RANKINE Link icon

      public static final TemperatureUnit RANKINE
      Rankine "°R".
  • Field Details Link icon

    • suffix Link icon

      public final String suffix
      Suffix for temperature value.
  • Method Details Link icon

    • values Link icon

      public static TemperatureUnit[] 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 Link icon

      public static TemperatureUnit 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
    • toCelcius Link icon

      public abstract double toCelcius(double temperature)
      Converts the temperature of the current temperature unit to Celcius.
      Parameters:
      temperature - The temperature.
      Returns:
      The temperature in Celcius.
    • toCelcius Link icon

      public abstract float toCelcius(float temperature)
      Converts the temperature of the current temperature unit to Celcius.
      Parameters:
      temperature - The temperature.
      Returns:
      The temperature in Celcius.
    • toFahrenheit Link icon

      public abstract double toFahrenheit(double temperature)
      Converts the temperature of the current temperature unit to Fahrenheit.
      Parameters:
      temperature - The temperature.
      Returns:
      The temperature in Fahrenheit.
    • toFahrenheit Link icon

      public abstract float toFahrenheit(float temperature)
      Converts the temperature of the current temperature unit to Fahrenheit.
      Parameters:
      temperature - The temperature.
      Returns:
      The temperature in Fahrenheit.
    • toKelvin Link icon

      public abstract double toKelvin(double temperature)
      Converts the temperature of the current temperature unit to Kelvin.
      Parameters:
      temperature - The temperature.
      Returns:
      The temperature in Kelvin.
    • toKelvin Link icon

      public abstract float toKelvin(float temperature)
      Converts the temperature of the current temperature unit to Kelvin.
      Parameters:
      temperature - The temperature.
      Returns:
      The temperature in Kelvin.
    • toRankine Link icon

      public abstract double toRankine(double temperature)
      Converts the temperature of the current temperature unit to Rankine.
      Parameters:
      temperature - The temperature.
      Returns:
      The temperature in Rankine.
    • toRankine Link icon

      public abstract float toRankine(float temperature)
      Converts the temperature of the current temperature unit to Rankine.
      Parameters:
      temperature - The temperature.
      Returns:
      The temperature in Rankine.
    • toType Link icon

      public double toType(double temperature, TemperatureUnit unit)
      Converts the temperature of the current temperature unit to the requested temperature unit type.
      Parameters:
      temperature - The temperature.
      unit - Requested conversion temperature unit type.
      Returns:
      The temperature in the requested unit type.
      Throws:
      NullPointerException - If unit is null.
    • toType Link icon

      public float toType(float temperature, TemperatureUnit unit)
      Converts the temperature of the current temperature unit to the requested temperature unit type.
      Parameters:
      temperature - The temperature.
      unit - Requested conversion temperature unit type.
      Returns:
      The temperature in the requested unit type.
      Throws:
      NullPointerException - If unit is null.