public abstract static class AbstractWeatherData.Main
extends java.lang.Object
Main
.
Standard behaviors like the has
and the get
methods for information about main weather elements (for example,
temperature, pressure, humidity, etc.) are defined here.
Constructor and Description |
---|
AbstractWeatherData.Main()
Non-parameterized constructor
|
AbstractWeatherData.Main(org.json.JSONObject jsonObj)
Parameterized constructor
|
Modifier and Type | Method and Description |
---|---|
float |
getHumidity()
Returns data for humidity of the city.
|
float |
getMaxTemperature()
Returns data for maximum temperature of the city.
|
float |
getMinTemperature()
Returns data for minimum temperature of the city.
|
float |
getPressure()
Returns data for pressure of the city.
|
float |
getTemperature()
Returns data for temperature of the city.
|
boolean |
hasHumidity()
Tells if the data for humidity of the city is available or not.
|
boolean |
hasMaxTemperature()
Tells if the data for maximum temperature of the city is available or
not.
|
boolean |
hasMinTemperature()
Tells if the data for minimum temperature of the city is available or
not.
|
boolean |
hasPressure()
Tells if the data for pressure of the city is available or not.
|
boolean |
hasTemperature()
Tells if the data for temperature of the city is available or not.
|
public AbstractWeatherData.Main()
Initializes variables as per following basis:
Boolean: false
Integral: Minimum value (MIN_VALUE)
Floating point: Not a number (NaN)
Others: null
public AbstractWeatherData.Main(org.json.JSONObject jsonObj)
Initializes variables from values from the given JSON object.
jsonObj
- JSON object containing data about main weather
elements. For example, temperature, pressure, etc.public boolean hasTemperature()
true
if data available, otherwise
false
public boolean hasMinTemperature()
true
if data available, otherwise
false
public boolean hasMaxTemperature()
true
if data available, otherwise
false
public boolean hasPressure()
true
if data available, otherwise
false
public boolean hasHumidity()
true
if data available, otherwise
false
public float getTemperature()
Float.NaN
, i.e., Not a Number.public float getMinTemperature()
Float.NaN
, i.e., Not a Number.public float getMaxTemperature()
Float.NaN
, i.e., Not a Number.public float getPressure()
Float.NaN
, i.e., Not a Number.public float getHumidity()
Float.NaN
, i.e., Not a Number.