public class DailyForecastData
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)
Objects: Data initialized with default/non-parameterized constructor
Others: null
Modifier and Type | Class and Description |
---|---|
static class |
DailyForecastData.City
Parses data about city (from the JSON data)
and provides methods to get/access the information.
|
static class |
DailyForecastData.Forecast
Parses data about forecasts (from the JSON data)
and provides methods to get/access the information.
|
Modifier and Type | Field and Description |
---|---|
private DailyForecastData.City |
city |
private java.util.List<DailyForecastData.Forecast> |
forecastList
List of forecast information
|
private int |
forecastListCount
Count (number) of elements in list of forecast information
|
private java.lang.String |
JSON_CITY
Key for JSON object - City
|
private java.lang.String |
JSON_FORECAST_LIST
Key for JSON object - List of forecasts
|
private java.lang.String |
JSON_RESPONSE_CODE
Key for JSON variable
Response code |
private java.lang.String |
JSON_RESPONSE_FORECAST_COUNT
Key for JSON variable
Forecast count |
private java.lang.String |
JSON_RESPONSE_TIME
Key for JSON variable
Response time |
private java.lang.String |
responseCode
Response code
|
private int |
responseForecastCount
Forecast count
|
private float |
responseTime
Response time
|
Constructor and Description |
---|
DailyForecastData(org.json.JSONObject jsonObj)
Parameterized constructor
Initializes variables from values from the given JSON object.
|
Modifier and Type | Method and Description |
---|---|
DailyForecastData.City |
getCity_Object() |
int |
getForecast_List_Count() |
java.util.List<DailyForecastData.Forecast> |
getForecast_List() |
java.lang.String |
getResponseCode() |
int |
getResponseForecastCount() |
float |
getResponseTime() |
boolean |
hasForecast_List() |
boolean |
hasResponseCode() |
boolean |
hasResponseForecastCount() |
boolean |
hasResponseTime() |
private final java.lang.String JSON_CITY
private final java.lang.String JSON_FORECAST_LIST
private final java.lang.String JSON_RESPONSE_CODE
Response code
private final java.lang.String JSON_RESPONSE_TIME
Response time
private final java.lang.String JSON_RESPONSE_FORECAST_COUNT
Forecast count
private final java.lang.String responseCode
private final float responseTime
private final int responseForecastCount
private final DailyForecastData.City city
private final java.util.List<DailyForecastData.Forecast> forecastList
private final int forecastListCount
public DailyForecastData(org.json.JSONObject jsonObj)
jsonObj
- JSON object containing data about daily forecastspublic boolean hasResponseCode()
public boolean hasResponseTime()
public boolean hasResponseForecastCount()
public java.lang.String getResponseCode()
public float getResponseTime()
public int getResponseForecastCount()
public DailyForecastData.City getCity_Object()
public boolean hasForecast_List()
public int getForecast_List_Count()
public java.util.List<DailyForecastData.Forecast> getForecast_List()