net.aksingh.owmjapis
Class AbstractForecast

java.lang.Object
  extended by net.aksingh.owmjapis.AbstractForecast
Direct Known Subclasses:
DailyForecast, HourlyForecast

public abstract class AbstractForecast
extends java.lang.Object

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

Since:
2.5.0.3
Version:
2014/12/27
Author:
Ashutosh Kumar Singh

Nested Class Summary
static class AbstractForecast.City
           Provides default behaviours for City
static class AbstractForecast.Forecast
           Parses forecast data (one element in the forecastList) and provides methods to get/access the same information.
 
Method Summary
 AbstractForecast.City getCityInstance()
           
 int getForecastCount()
           
 double getMessage()
           
 java.lang.String getRawResponse()
           
 int getResponseCode()
           
 boolean hasCityInstance()
           
 boolean hasForecastCount()
           
 boolean hasMessage()
           
 boolean hasRawResponse()
           
 boolean hasResponseCode()
           
 boolean isValid()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasMessage

public boolean hasMessage()
Returns:
true if message is available, otherwise false.

hasForecastCount

public boolean hasForecastCount()
Returns:
true if count of forecasts is available, otherwise false.

hasCityInstance

public boolean hasCityInstance()
Returns:
true if message is available, otherwise false.

getMessage

public double getMessage()
Returns:
Message if available, otherwise Double.NaN.

getForecastCount

public int getForecastCount()
Returns:
Count of forecasts if available, otherwise 0.

getCityInstance

public AbstractForecast.City getCityInstance()
Returns:
City's 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.