public static class DailyForecastData.Forecast extends AbstractWeatherData
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 | Class and Description |
---|---|
static class |
DailyForecastData.Forecast.Temperature
Parses data about temperature (from the JSON data)
and provides methods to get/access the information.
|
static class |
DailyForecastData.Forecast.Weather
Parses data about weather (from the JSON data)
and provides methods to get/access the information.
|
AbstractWeatherData.Clouds, AbstractWeatherData.Coord, AbstractWeatherData.Main, AbstractWeatherData.Wind
Modifier and Type | Field and Description |
---|---|
private float |
cloudsPercent
Percentage of clouds
|
private float |
humidity
Humidity
|
private java.lang.String |
JSON_FORECAST_CLOUDS
Key for JSON variable
Percentage of clouds |
private java.lang.String |
JSON_FORECAST_HUMIDITY
Key for JSON variable
Humidity |
private java.lang.String |
JSON_FORECAST_PRESSURE
Key for JSON variable
Pressure |
private java.lang.String |
JSON_FORECAST_WIND_DEGREE
Key for JSON variable
Wind degree |
private java.lang.String |
JSON_FORECAST_WIND_SPEED
Key for JSON variable
Wind speed |
java.lang.String |
JSON_TEMP
Key for JSON object - Temperature
|
private float |
pressure
Pressure
|
private DailyForecastData.Forecast.Temperature |
temp |
private java.util.List<DailyForecastData.Forecast.Weather> |
weatherList
List of weather information (code, name, etc.)
|
private int |
weatherListCount
Count (number) of elements in list of weather information
|
private float |
windDegree
Wind degree
|
private float |
windSpeed
Wind speed
|
JSON_CLOUDS, JSON_COORD, JSON_MAIN, JSON_WEATHER, JSON_WIND
Constructor and Description |
---|
DailyForecastData.Forecast()
Non-parameterized constructor
|
DailyForecastData.Forecast(org.json.JSONObject jsonObj)
Parameterized constructor
Initializes variables from values from the given JSON object.
|
Modifier and Type | Method and Description |
---|---|
float |
getHumidity() |
float |
getPercentageOfClouds() |
float |
getPressure() |
DailyForecastData.Forecast.Temperature |
getTemperature_Object() |
int |
getWeather_List_Count() |
java.util.List<DailyForecastData.Forecast.Weather> |
getWeather_List() |
float |
getWindDegree() |
float |
getWindSpeed() |
boolean |
hasHumidity() |
boolean |
hasPercentageOfClouds() |
boolean |
hasPressure() |
boolean |
hasWeather_List() |
boolean |
hasWindDegree() |
boolean |
hasWindSpeed() |
getDateTime, hasDateTime
public final java.lang.String JSON_TEMP
private final java.lang.String JSON_FORECAST_PRESSURE
Pressure
private final java.lang.String JSON_FORECAST_HUMIDITY
Humidity
private final java.lang.String JSON_FORECAST_WIND_SPEED
Wind speed
private final java.lang.String JSON_FORECAST_WIND_DEGREE
Wind degree
private final java.lang.String JSON_FORECAST_CLOUDS
Percentage of clouds
private final float pressure
private final float humidity
private final float windSpeed
private final float windDegree
private final float cloudsPercent
private final DailyForecastData.Forecast.Temperature temp
private final java.util.List<DailyForecastData.Forecast.Weather> weatherList
private final int weatherListCount
public DailyForecastData.Forecast()
Initializes variables as per following basis:
Boolean: false
Integral: Minimum value (MIN_VALUE)
Floating point: Not a number (NaN)
Others: null
public DailyForecastData.Forecast(org.json.JSONObject jsonObj)
jsonObj
- JSON object containing data about forecastspublic boolean hasHumidity()
public boolean hasPressure()
public boolean hasWindSpeed()
public boolean hasWindDegree()
public boolean hasPercentageOfClouds()
public float getHumidity()
public float getPressure()
public float getWindSpeed()
public float getWindDegree()
public float getPercentageOfClouds()
public DailyForecastData.Forecast.Temperature getTemperature_Object()
public boolean hasWeather_List()
public int getWeather_List_Count()
public java.util.List<DailyForecastData.Forecast.Weather> getWeather_List()