Class Weather

java.lang.Object
  extended by Weather

public class Weather
extends java.lang.Object

A helper class that fetch weather status for a specific location
It uses "The Weather Underground Core" API.

 class WeatherQuery
 {
     private Weather weather = new Weather("France", "Paris");
     
     public exampleMethod()
     {
         double temperature = weather.getTemperature();
         String windDirection = weather.getWindDirection();
         int humidity = weather.getHumidity();
         
         System.out.println("The current temperature in " + 
             weather.getCity() + " is " + temperature + " degrees");
     }
 }
 


Constructor Summary
Weather()
          construct an object to get local weather status.
Weather(java.lang.String country, java.lang.String city)
          Construct an object to get weather status in a specific city.
 
Method Summary
 java.lang.String getCity()
          get the city name.
 java.lang.String getCountry()
          get the country name.
 int getHumidity()
          Fetch the current humidity.
 double getPressure()
          Fetch the current atmospheric air pressure in hectopascal (hPa).
 double getTemperature()
          Fetch the current temperature in Celsius.
 java.lang.String getWindDirection()
          Fetch the direction of the wind.
 double getWindSpeed()
          Fetch the current speed of the wind in km/h.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Weather

public Weather()
construct an object to get local weather status.


Weather

public Weather(java.lang.String country,
               java.lang.String city)
Construct an object to get weather status in a specific city.

Parameters:
country - the country name
city - the city name
Method Detail

getTemperature

public double getTemperature()
Fetch the current temperature in Celsius.


getWindSpeed

public double getWindSpeed()
Fetch the current speed of the wind in km/h.


getWindDirection

public java.lang.String getWindDirection()
Fetch the direction of the wind.


getHumidity

public int getHumidity()
Fetch the current humidity.


getPressure

public double getPressure()
Fetch the current atmospheric air pressure in hectopascal (hPa).


getCity

public java.lang.String getCity()
get the city name.


getCountry

public java.lang.String getCountry()
get the country name.