net.aksingh.owmjapis
Class CurrentWeather

java.lang.Object
  extended by net.aksingh.owmjapis.AbstractWeather
      extended by net.aksingh.owmjapis.CurrentWeather

public class CurrentWeather
extends AbstractWeather

Parses current weather data and provides methods to get/access the same information. This class provides 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

Since:
2.5.0.1
Version:
2014/12/26
Author:
Ashutosh Kumar Singh
See Also:
OWM's Current Weather API

Nested Class Summary
static class CurrentWeather.Clouds
           Parses clouds data and provides methods to get/access the same information.
static class CurrentWeather.Coord
           Parses coordination data and provides methods to get/access the same information.
static class CurrentWeather.Main
           Parses main data and provides methods to get/access the same information.
static class CurrentWeather.Rain
           Parses rain data and provides methods to get/access the same information.
static class CurrentWeather.Sys
           Parses sys data and provides methods to get/access the same information.
static class CurrentWeather.Wind
           Parses wind data and provides methods to get/access the same information.
 
Nested classes/interfaces inherited from class net.aksingh.owmjapis.AbstractWeather
AbstractWeather.Weather
 
Method Summary
 java.lang.String getBaseStation()
           
 long getCityCode()
           
 java.lang.String getCityName()
           
 CurrentWeather.Clouds getCloudsInstance()
           
 CurrentWeather.Coord getCoordInstance()
           
 CurrentWeather.Main getMainInstance()
           
 CurrentWeather.Rain getRainInstance()
           
 java.lang.String getRawResponse()
           
 int getResponseCode()
           
 CurrentWeather.Sys getSysInstance()
           
 CurrentWeather.Wind getWindInstance()
           
 boolean hasBaseStation()
           
 boolean hasCityCode()
           
 boolean hasCityName()
           
 boolean hasCloudsInstance()
           
 boolean hasCoordInstance()
           
 boolean hasMainInstance()
           
 boolean hasRainInstance()
           
 boolean hasRawResponse()
           
 boolean hasResponseCode()
           
 boolean hasSysInstance()
           
 boolean hasWindInstance()
           
 boolean isValid()
           
 
Methods inherited from class net.aksingh.owmjapis.AbstractWeather
getDateTime, getWeatherCount, getWeatherInstance, hasDateTime, hasWeatherInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasBaseStation

public boolean hasBaseStation()
Returns:
true if base station is available, otherwise false.

hasCityCode

public boolean hasCityCode()
Returns:
true if city code is available, otherwise false.

hasCityName

public boolean hasCityName()
Returns:
true if city name is available, otherwise false.

hasCloudsInstance

public boolean hasCloudsInstance()
Returns:
true if Clouds instance is available, otherwise false.

hasCoordInstance

public boolean hasCoordInstance()
Returns:
true if Coord instance is available, otherwise false.

hasMainInstance

public boolean hasMainInstance()
Returns:
true if Main instance is available, otherwise false.

hasRainInstance

public boolean hasRainInstance()
Returns:
true if Rain instance is available, otherwise false.

hasSysInstance

public boolean hasSysInstance()
Returns:
true if Sys instance is available, otherwise false.

hasWindInstance

public boolean hasWindInstance()
Returns:
true if Wind instance is available, otherwise false.

getBaseStation

public java.lang.String getBaseStation()
Returns:
Base station if available, otherwise null.

getCityCode

public long getCityCode()
Returns:
City code if available, otherwise Long.MIN_VALUE.

getCityName

public java.lang.String getCityName()
Returns:
City name if available, otherwise null.

getCloudsInstance

public CurrentWeather.Clouds getCloudsInstance()
Returns:
Clouds instance if available, otherwise null.

getCoordInstance

public CurrentWeather.Coord getCoordInstance()
Returns:
Coord instance if available, otherwise null.

getMainInstance

public CurrentWeather.Main getMainInstance()
Returns:
Main instance if available, otherwise null.

getRainInstance

public CurrentWeather.Rain getRainInstance()
Returns:
Rain instance if available, otherwise null.

getSysInstance

public CurrentWeather.Sys getSysInstance()
Returns:
Sys instance if available, otherwise null.

getWindInstance

public CurrentWeather.Wind getWindInstance()
Returns:
Wind instance if available, otherwise null.

isValid

public boolean isValid()
Returns:
true if response is valid (downloaded and parsed correctly), otherwise false.

hasResponseCode

public boolean hasResponseCode()
Returns:
true if response code is available, otherwise false.

hasRawResponse

public boolean hasRawResponse()
Returns:
true if raw response is available, otherwise false.

getResponseCode

public int getResponseCode()
Returns:
Response code if available, otherwise Integer.MIN_VALUE.

getRawResponse

public java.lang.String getRawResponse()
Returns:
Raw response if available, otherwise null.