public class CurrentWeatherData 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 |
CurrentWeatherData.Clouds
Parses data about clouds (from the JSON data) and provides methods to
get/access the information.
|
static class |
CurrentWeatherData.Coord
Parses data about geographic coordinates (from the JSON data) and
provides methods to get/access the information.
|
static class |
CurrentWeatherData.Main
Parses data about main weather elements (from the JSON data) and provides
methods to get/access the information.
|
static class |
CurrentWeatherData.Rain
Parses data about rain (from the JSON data) and provides methods to
get/access the information.
|
static class |
CurrentWeatherData.Sys
Parses data about country, sunrise, and sunset (from the JSON data) and
provides methods to get/access the information.
|
static class |
CurrentWeatherData.Weather
Parses data about weather code, name, etc.
|
static class |
CurrentWeatherData.Wind
Parses data about winds (from the JSON data) and provides methods to
get/access the information.
|
JSON_CLOUDS, JSON_COORD, JSON_MAIN, JSON_WEATHER, JSON_WIND
Constructor and Description |
---|
CurrentWeatherData(org.json.JSONObject jsonObj)
Parameterized constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getBaseStation() |
long |
getCityCode() |
java.lang.String |
getCityName() |
CurrentWeatherData.Clouds |
getClouds_Object() |
CurrentWeatherData.Coord |
getCoordinates_Object() |
CurrentWeatherData.Main |
getMainData_Object() |
CurrentWeatherData.Rain |
getRain_Object() |
int |
getResponseCode() |
CurrentWeatherData.Sys |
getSysData_Object() |
int |
getWeather_List_Count() |
java.util.List<CurrentWeatherData.Weather> |
getWeather_List() |
CurrentWeatherData.Wind |
getWind_Object() |
boolean |
hasBaseStation() |
boolean |
hasCityCode() |
boolean |
hasCityName() |
boolean |
hasResponseCode() |
boolean |
hasWeather_List() |
getDateTime, hasDateTime
public CurrentWeatherData(org.json.JSONObject jsonObj)
Initializes variables from values from the given JSON object.
jsonObj
- JSON object containing current weather datapublic boolean hasBaseStation()
public boolean hasCityCode()
public boolean hasCityName()
public boolean hasResponseCode()
public java.lang.String getBaseStation()
public long getCityCode()
public java.lang.String getCityName()
public int getResponseCode()
public CurrentWeatherData.Clouds getClouds_Object()
public CurrentWeatherData.Coord getCoordinates_Object()
public CurrentWeatherData.Main getMainData_Object()
public CurrentWeatherData.Rain getRain_Object()
public CurrentWeatherData.Sys getSysData_Object()
public CurrentWeatherData.Wind getWind_Object()
public boolean hasWeather_List()
public int getWeather_List_Count()
public java.util.List<CurrentWeatherData.Weather> getWeather_List()