Package com.iizix
Enum Class TemperatureUnit
- All Implemented Interfaces:
- Serializable,- Comparable<TemperatureUnit>,- Constable
Enum for temperature types.
- Nested Class Summary- Nested classes/interfaces inherited from class java.lang.Enum- Enum.EnumDesc<E extends Enum<E>>
- Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionCelcius formatted as "°C".Fahrenheit formatted as "°F".Kelvin "°K".Rankine "°R".
- Field SummaryFields
- Method SummaryModifier and TypeMethodDescription- 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.- static TemperatureUnitReturns the enum constant of this class with the specified name.- static TemperatureUnit[]- values()Returns an array containing the constants of this enum class, in the order they are declared.
- Enum Constant Details- CELCIUSCelcius formatted as "°C".
- FAHRENHEITFahrenheit formatted as "°F".
- KELVINKelvin "°K".
- RANKINERankine "°R".
 
- Field Details- suffixSuffix for temperature value.
 
- Method Details- valuesReturns 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
 
- valueOfReturns 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
 
- toCelciuspublic abstract double toCelcius- (double temperature) Converts the temperature of the current temperature unit to Celcius.- Parameters:
- temperature- The temperature.
- Returns:
- The temperature in Celcius.
 
- toCelciuspublic abstract float toCelcius- (float temperature) Converts the temperature of the current temperature unit to Celcius.- Parameters:
- temperature- The temperature.
- Returns:
- The temperature in Celcius.
 
- toFahrenheitpublic abstract double toFahrenheit- (double temperature) Converts the temperature of the current temperature unit to Fahrenheit.- Parameters:
- temperature- The temperature.
- Returns:
- The temperature in Fahrenheit.
 
- toFahrenheitpublic abstract float toFahrenheit- (float temperature) Converts the temperature of the current temperature unit to Fahrenheit.- Parameters:
- temperature- The temperature.
- Returns:
- The temperature in Fahrenheit.
 
- toKelvinpublic abstract double toKelvin- (double temperature) Converts the temperature of the current temperature unit to Kelvin.- Parameters:
- temperature- The temperature.
- Returns:
- The temperature in Kelvin.
 
- toKelvinpublic abstract float toKelvin- (float temperature) Converts the temperature of the current temperature unit to Kelvin.- Parameters:
- temperature- The temperature.
- Returns:
- The temperature in Kelvin.
 
- toRankinepublic abstract double toRankine- (double temperature) Converts the temperature of the current temperature unit to Rankine.- Parameters:
- temperature- The temperature.
- Returns:
- The temperature in Rankine.
 
- toRankinepublic abstract float toRankine- (float temperature) Converts the temperature of the current temperature unit to Rankine.- Parameters:
- temperature- The temperature.
- Returns:
- The temperature in Rankine.
 
- toTypeConverts 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- unitis- null.
 
- toTypeConverts 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- unitis- null.