public static class CurrentWeatherData.Sys
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 |
---|---|
private java.lang.String |
countryCode
Country code for the city
|
private java.lang.String |
JSON_SYS_COUNTRY_CODE
Key for JSON variable
Sys -> Country |
private java.lang.String |
JSON_SYS_SUNRISE
Key for JSON variable
Sys -> Sunrise |
private java.lang.String |
JSON_SYS_SUNSET
Key for JSON variable
Sys -> Sunset |
private java.util.Date |
sunrise
Sunrise time
|
private java.util.Date |
sunset
Sunset time
|
Constructor and Description |
---|
CurrentWeatherData.Sys()
Non-parameterized constructor
|
CurrentWeatherData.Sys(org.json.JSONObject jsonObj)
Parameterized constructor
Initializes variables from values from the given JSON object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCountryCode() |
java.util.Date |
getSunriseTime() |
java.util.Date |
getSunsetTime() |
boolean |
hasCountryCode() |
boolean |
hasSunriseTime() |
boolean |
hasSunsetTime() |
private final java.lang.String JSON_SYS_COUNTRY_CODE
Sys -> Country
private final java.lang.String JSON_SYS_SUNRISE
Sys -> Sunrise
private final java.lang.String JSON_SYS_SUNSET
Sys -> Sunset
private final java.lang.String countryCode
private final java.util.Date sunrise
private final java.util.Date sunset
public CurrentWeatherData.Sys()
Initializes variables as per following basis:
Boolean: false
Integral: Minimum value (MIN_VALUE)
Floating point: Not a number (NaN)
Others: null
public CurrentWeatherData.Sys(org.json.JSONObject jsonObj)
jsonObj
- JSON object containing data about country, sunrise,
and sunset.public boolean hasCountryCode()
public boolean hasSunriseTime()
public boolean hasSunsetTime()
public java.lang.String getCountryCode()
public java.util.Date getSunriseTime()
public java.util.Date getSunsetTime()