|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<TemperatureUnit>
org.ka2ddo.util.TemperatureUnit
public enum TemperatureUnit
This enumeration declares units (with conversion factors) for measuring temperatures. The default internal temperature units for APRS are degrees Fahrenheit, because that is what is specified by the message protocols.
Enum Constant Summary | |
---|---|
C
Temperature in degrees Celsius. |
|
F
Temperature in degrees Fahrenheit. |
|
K
Temperature in degrees Kelvin. |
Method Summary | |
---|---|
float |
from(TemperatureUnit other)
Get the multiplicative conversion factor to convert a value from the specified units to this unit. |
float |
fromFahrenheit(float tempF)
Convert the specified temperature from this unit to Fahrenheit. |
float |
getOffset(TemperatureUnit other)
Get the additive offset to convert a value from the specified unit to this unit. |
float |
toFahrenheit(float temp)
Convert the specified temperature from this unit to Fahrenheit. |
java.lang.String |
unitString()
Get the string to use when displaying values of this unit. |
static TemperatureUnit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static TemperatureUnit[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final TemperatureUnit F
public static final TemperatureUnit C
public static final TemperatureUnit K
Method Detail |
---|
public static TemperatureUnit[] values()
for (TemperatureUnit c : TemperatureUnit.values()) System.out.println(c);
public static TemperatureUnit valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is nullpublic final float toFahrenheit(float temp)
temp
- temperature in the units of this TemperatureUnit
public final float fromFahrenheit(float tempF)
tempF
- temperature in degrees Fahrenheit
public final java.lang.String unitString()
public float from(TemperatureUnit other)
from
in interface UnitEnum<TemperatureUnit>
other
- another TemperatureUnit representing the existing units of a value
public float getOffset(TemperatureUnit other)
getOffset
in interface UnitEnum<TemperatureUnit>
other
- another TemperatureUnit representing the existing units of a value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |