public abstract static class AbstractWeatherData.Coord
extends java.lang.Object
Coord
.
Standard behaviors like the has
and the get
methods for information about geographic coordinates (latitude
and longitude) are defined here.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
JSON_COORD_LATITUDE
Key for JSON variable
Coord -> Latitude |
private java.lang.String |
JSON_COORD_LONGITUDE
Key for JSON variable
Coord -> Longitude |
private float |
lat
Latitude
|
private float |
lon
Longitude
|
Constructor and Description |
---|
AbstractWeatherData.Coord()
Non-parameterized constructor
|
AbstractWeatherData.Coord(org.json.JSONObject jsonObj)
Parameterized constructor
Initializes variables from values from the given JSON object.
|
Modifier and Type | Method and Description |
---|---|
float |
getLatitude()
Returns data for latitude of the city.
|
float |
getLongitude()
Returns data for longitude of the city.
|
boolean |
hasLatitude()
Tells if the data for latitude of the city is available or not.
|
boolean |
hasLongitude()
Tells if the data for longitude of the city is available or not.
|
private final java.lang.String JSON_COORD_LATITUDE
Coord -> Latitude
private final java.lang.String JSON_COORD_LONGITUDE
Coord -> Longitude
private final float lat
private final float lon
public AbstractWeatherData.Coord()
Initializes variables as per following basis:
Boolean: false
Integral: Minimum value (MIN_VALUE)
Floating point: Not a number (NaN)
Others: null
public AbstractWeatherData.Coord(org.json.JSONObject jsonObj)
jsonObj
- JSON object containing data about coordinatespublic boolean hasLatitude()
true
if data available, otherwise false
public boolean hasLongitude()
true
if data available, otherwise false
public float getLatitude()
Float.NaN
, i.e., Not a Number.public float getLongitude()
Float.NaN
, i.e., Not a Number.