public abstract static class AbstractWeatherData.Wind
extends java.lang.Object
Wind
.
Standard behaviors like the has
and the get
methods for information about wind (for example, speed, degree,
etc.) are defined here.Modifier and Type | Field and Description |
---|---|
private float |
degree
Wind degree (direction of wind)
|
private java.lang.String |
JSON_WIND_DEGREE
Key for JSON variable
Wind -> Degree |
private java.lang.String |
JSON_WIND_SPEED
Key for JSON variable
Wind -> Speed |
private float |
speed
Wind speed
|
Constructor and Description |
---|
AbstractWeatherData.Wind()
Non-parameterized constructor
|
AbstractWeatherData.Wind(org.json.JSONObject jsonObj)
Parameterized constructor
Initializes variables from values from the given JSON object.
|
Modifier and Type | Method and Description |
---|---|
float |
getWindDegree()
Returns data for degree of wind in the city.
|
float |
getWindSpeed()
Returns data for speed of wind in the city.
|
boolean |
hasWindDegree()
Tells if the data for degree (degree gives direction) of wind
in the city is available or not.
|
boolean |
hasWindSpeed()
Tells if the data for speed of wind in the city is available or not.
|
private final java.lang.String JSON_WIND_SPEED
Wind -> Speed
private final java.lang.String JSON_WIND_DEGREE
Wind -> Degree
private final float speed
private final float degree
public AbstractWeatherData.Wind()
Initializes variables as per following basis:
Boolean: false
Integral: Minimum value (MIN_VALUE)
Floating point: Not a number (NaN)
Others: null
public AbstractWeatherData.Wind(org.json.JSONObject jsonObj)
jsonObj
- JSON object containing data about windpublic boolean hasWindSpeed()
true
if data available, otherwise false
public boolean hasWindDegree()
true
if data available, otherwise false
public float getWindSpeed()
Float.NaN
, i.e., Not a Number.public float getWindDegree()
Float.NaN
, i.e., Not a Number.