public static class DailyForecastData.Forecast.Temperature
extends java.lang.Object
has
and get
methods to access the information.
has
methods can be used to check if the data exists,
i.e., if the data was available (successfully downloaded) and was
parsed correctly.
get
methods can be used to access the data, if the data
exists, otherwise get
methods will give value as per
following basis:
Boolean: false
Integral: Minimum value (MIN_VALUE)
Floating point: Not a number (NaN)
Others: null
Modifier and Type | Field and Description |
---|---|
java.lang.String |
JSON_TEMP_DAY
Key for JSON variable
Temp -> Day |
java.lang.String |
JSON_TEMP_EVENING
Key for JSON variable
Temp -> Evening |
java.lang.String |
JSON_TEMP_MAX
Key for JSON variable
Temp -> Maximum |
java.lang.String |
JSON_TEMP_MIN
Key for JSON variable
Temp -> Minimum |
java.lang.String |
JSON_TEMP_MORNING
Key for JSON variable
Temp -> Morning |
java.lang.String |
JSON_TEMP_NIGHT
Key for JSON variable
Temp -> Night |
Constructor and Description |
---|
DailyForecastData.Forecast.Temperature()
Non-parameterized constructor
|
DailyForecastData.Forecast.Temperature(org.json.JSONObject jsonObj)
Parameterized constructor
|
Modifier and Type | Method and Description |
---|---|
float |
getDayTemperature() |
float |
getEveningTemperature() |
float |
getMaximumTemperature() |
float |
getMinimumTemperature() |
float |
getMorningTemperature() |
float |
getNightTemperature() |
boolean |
hasDayTemperature() |
boolean |
hasEveningTemperature() |
boolean |
hasMaximumTemperature() |
boolean |
hasMinimumTemperature() |
boolean |
hasMorningTemperature() |
boolean |
hasNightTemperature() |
public final java.lang.String JSON_TEMP_DAY
Temp -> Day
public final java.lang.String JSON_TEMP_MIN
Temp -> Minimum
public final java.lang.String JSON_TEMP_MAX
Temp -> Maximum
public final java.lang.String JSON_TEMP_NIGHT
Temp -> Night
public final java.lang.String JSON_TEMP_EVENING
Temp -> Evening
public final java.lang.String JSON_TEMP_MORNING
Temp -> Morning
public DailyForecastData.Forecast.Temperature()
Initializes variables as per following basis:
Boolean: false
Integral: Minimum value (MIN_VALUE)
Floating point: Not a number (NaN)
Others: null
public DailyForecastData.Forecast.Temperature(org.json.JSONObject jsonObj)
Initializes variables from values from the given JSON object.
jsonObj
- JSON object containing data about temperaturepublic boolean hasDayTemperature()
public boolean hasMinimumTemperature()
public boolean hasMaximumTemperature()
public boolean hasNightTemperature()
public boolean hasEveningTemperature()
public boolean hasMorningTemperature()
public float getDayTemperature()
public float getMinimumTemperature()
public float getMaximumTemperature()
public float getNightTemperature()
public float getEveningTemperature()
public float getMorningTemperature()