Enum Class TemperatureUnit

java.lang.Object
java.lang.Enum<TemperatureUnit>
com.github.thedeathlycow.thermoo.api.util.TemperatureUnit
All Implemented Interfaces:
Serializable, Comparable<TemperatureUnit>, Constable, net.minecraft.util.StringIdentifiable

public enum TemperatureUnit extends Enum<TemperatureUnit> implements net.minecraft.util.StringIdentifiable
Defines the basic units of temperature and allows for conversions between them.
  • Enum Constant Details

  • Method Details

    • values

      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

      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
    • getUnitSymbol

      public String getUnitSymbol()
    • toCelsius

      public double toCelsius(double value)
      Converts a temperature value in this unit to Celsius.
      Parameters:
      value - A temperature value in this unit
      Returns:
      Returns the equivalent temperature value in Celsius
    • fromCelsius

      public double fromCelsius(double celsiusValue)
      Converts a temperature value in Celsius to this unit.
      Parameters:
      celsiusValue - A temperature value in Celsius
      Returns:
      Returns the equivalent temperature value in this unit
    • convertTemperature

      public double convertTemperature(double inputValue, TemperatureUnit inputUnit)
      Converts a temperature in some other unit to this unit.
      Parameters:
      inputValue - The input temperature value in the other unit
      inputUnit - The other unit
      Returns:
      Returns the equivalent temperature value in this unit.
    • asString

      public String asString()
      Specified by:
      asString in interface net.minecraft.util.StringIdentifiable