net.aksingh.owmjapis
Class AbstractWeather

java.lang.Object
  extended by net.aksingh.owmjapis.AbstractWeather
Direct Known Subclasses:
AbstractForecast.Forecast, CurrentWeather

public abstract class AbstractWeather
extends java.lang.Object

Provides default behaviours and implementations for: 1. CurrentWeather It defines common methods like has, get and some others.

Since:
2.5.0.1
Version:
2014/12/21
Author:
Ashutosh Kumar Singh

Nested Class Summary
static class AbstractWeather.Clouds
           Provides default behaviours for Cloud
static class AbstractWeather.Coord
           Provides default behaviours for Coord, i.e., coordinates.
static class AbstractWeather.Main
           Provides default behaviours for Main, i.e., main weather elements like temperature, humidity, etc.
static class AbstractWeather.Weather
           Parses weather data and provides methods to get/access the same information.
static class AbstractWeather.Wind
           Provides default behaviours for Wind.
 
Method Summary
 java.util.Date getDateTime()
           
 java.lang.String getRawResponse()
           
 int getResponseCode()
           
 int getWeatherCount()
           
 AbstractWeather.Weather getWeatherInstance(int index)
           
 boolean hasDateTime()
           
 boolean hasRawResponse()
           
 boolean hasResponseCode()
           
 boolean hasWeatherInstance()
           
 boolean isValid()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasDateTime

public boolean hasDateTime()
Returns:
true if date/time is available, otherwise false.

hasWeatherInstance

public boolean hasWeatherInstance()
Returns:
true if Weather instance(s) is available, otherwise false.

getDateTime

public java.util.Date getDateTime()
Returns:
Date and time if available, otherwise null.

getWeatherCount

public int getWeatherCount()
Returns:
Count of Weather instance(s) if available, otherwise 0.

getWeatherInstance

public AbstractWeather.Weather getWeatherInstance(int index)
Parameters:
index - Index of Weather instance in the list.
Returns:
Weather 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.