java.lang.Object |
↳ |
lineageos.weather.util.WeatherUtils |
Class Overview
Helper class to perform operations and formatting of weather data
Summary
Public Methods |
static
double
|
celsiusToFahrenheit(double celsius)
Converts a temperature expressed in degrees Celsius to degrees Fahrenheit
|
static
double
|
fahrenheitToCelsius(double fahrenheit)
Converts a temperature expressed in degrees Fahrenheit to degrees Celsius
|
static
String
|
formatTemperature(double temperature, int tempUnit)
Returns a string representation of the temperature and unit supplied.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public Constructors
Public Methods
public
static
double
celsiusToFahrenheit
(double celsius)
Converts a temperature expressed in degrees Celsius to degrees Fahrenheit
Parameters |
celsius |
double : temperature in Celsius |
Returns |
double |
the temperature in degrees Fahrenheit
|
public
static
double
fahrenheitToCelsius
(double fahrenheit)
Converts a temperature expressed in degrees Fahrenheit to degrees Celsius
Parameters |
fahrenheit |
double : temperature in Fahrenheit |
Returns |
double |
the temperature in degrees Celsius
|
public
static
String
formatTemperature
(double temperature, int tempUnit)
Returns a string representation of the temperature and unit supplied. The temperature value
will be half-even rounded.
Returns |
String |
A string with the format XX°F or XX°C (where XX is the temperature)
depending on the temperature unit that was provided or null if an invalid unit is supplied
|