|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.aksingh.owmjapis.OpenWeatherMap
public class OpenWeatherMap
Lets you access data from OpenWeatherMap.org using its Web APIs. Henceforth, it's shortened as OWM.org to ease commenting.
Sample code:
OpenWeatherMap.org owm = new OpenWeatherMap("your-api-key");
OpenWeatherMap.org owm = new OpenWeatherMap(your-units, "your-api-key");
OpenWeatherMap.org owm = new OpenWeatherMap(your-units, your-language, "your-api-key");
Nested Class Summary | |
---|---|
static class |
OpenWeatherMap.Language
Languages that can be set for getting data from OWM.org |
static class |
OpenWeatherMap.OWMAddress
Generates addresses for accessing the information from OWM.org |
static class |
OpenWeatherMap.Units
Units that can be set for getting data from OWM.org |
Constructor Summary | |
---|---|
OpenWeatherMap(OpenWeatherMap.Units units,
OpenWeatherMap.Language lang,
java.lang.String apiKey)
Constructor |
|
OpenWeatherMap(OpenWeatherMap.Units units,
java.lang.String apiKey)
Constructor |
|
OpenWeatherMap(java.lang.String apiKey)
Constructor |
Method Summary | |
---|---|
CurrentWeather |
currentWeatherByCityCode(long cityCode)
|
CurrentWeather |
currentWeatherByCityName(java.lang.String cityName)
|
CurrentWeather |
currentWeatherByCityName(java.lang.String cityName,
java.lang.String countryCode)
|
CurrentWeather |
currentWeatherByCoordinates(float latitude,
float longitude)
|
CurrentWeather |
currentWeatherFromRawResponse(java.lang.String response)
|
DailyForecast |
dailyForecastByCityCode(long cityCode,
byte count)
|
DailyForecast |
dailyForecastByCityName(java.lang.String cityName,
byte count)
|
DailyForecast |
dailyForecastByCityName(java.lang.String cityName,
java.lang.String countryCode,
byte count)
|
DailyForecast |
dailyForecastByCoordinates(float latitude,
float longitude,
byte count)
|
DailyForecast |
dailyForecastFromRawResponse(java.lang.String response)
|
java.lang.String |
getApiKey()
|
OpenWeatherMap.Language |
getLang()
|
java.lang.String |
getMode()
|
OpenWeatherMap.OWMAddress |
getOwmAddressInstance()
|
OpenWeatherMap.Units |
getUnits()
|
HourlyForecast |
hourlyForecastByCityCode(long cityCode)
|
HourlyForecast |
hourlyForecastByCityName(java.lang.String cityName)
|
HourlyForecast |
hourlyForecastByCityName(java.lang.String cityName,
java.lang.String countryCode)
|
HourlyForecast |
hourlyForecastByCoordinates(float latitude,
float longitude)
|
HourlyForecast |
hourlyForecastFromRawResponse(java.lang.String response)
|
void |
setApiKey(java.lang.String appId)
Set API key for getting data from OWM.org |
void |
setLang(OpenWeatherMap.Language lang)
Set language for getting data from OWM.org |
void |
setUnits(OpenWeatherMap.Units units)
Set units for getting data from OWM.org |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OpenWeatherMap(java.lang.String apiKey)
apiKey
- API key from OWM.orgpublic OpenWeatherMap(OpenWeatherMap.Units units, java.lang.String apiKey)
units
- Any constant from UnitsapiKey
- API key from OWM.orgOpenWeatherMap.Units
,
OWM.org API Keypublic OpenWeatherMap(OpenWeatherMap.Units units, OpenWeatherMap.Language lang, java.lang.String apiKey)
units
- Any constant from Unitslang
- Any constant from LanguageapiKey
- API key from OWM.orgOpenWeatherMap.Units
,
OpenWeatherMap.Language
,
OWM.org's Multilingual support,
OWM.org's API KeyMethod Detail |
---|
public OpenWeatherMap.OWMAddress getOwmAddressInstance()
public java.lang.String getApiKey()
public OpenWeatherMap.Units getUnits()
public java.lang.String getMode()
public OpenWeatherMap.Language getLang()
public void setUnits(OpenWeatherMap.Units units)
units
- Any constant from UnitsOpenWeatherMap.Units
public void setApiKey(java.lang.String appId)
appId
- API key from OWM.orgpublic void setLang(OpenWeatherMap.Language lang)
lang
- Any constant from LanguageOpenWeatherMap.Language
,
OWM.org's Multilingual supportpublic CurrentWeather currentWeatherByCityName(java.lang.String cityName) throws java.io.IOException, org.json.JSONException
java.io.IOException
org.json.JSONException
public CurrentWeather currentWeatherByCityName(java.lang.String cityName, java.lang.String countryCode) throws java.io.IOException, org.json.JSONException
java.io.IOException
org.json.JSONException
public CurrentWeather currentWeatherByCityCode(long cityCode) throws org.json.JSONException
org.json.JSONException
public CurrentWeather currentWeatherByCoordinates(float latitude, float longitude) throws org.json.JSONException
org.json.JSONException
public CurrentWeather currentWeatherFromRawResponse(java.lang.String response) throws org.json.JSONException
org.json.JSONException
public HourlyForecast hourlyForecastByCityName(java.lang.String cityName) throws java.io.IOException, org.json.JSONException
java.io.IOException
org.json.JSONException
public HourlyForecast hourlyForecastByCityName(java.lang.String cityName, java.lang.String countryCode) throws java.io.IOException, org.json.JSONException
java.io.IOException
org.json.JSONException
public HourlyForecast hourlyForecastByCityCode(long cityCode) throws org.json.JSONException
org.json.JSONException
public HourlyForecast hourlyForecastByCoordinates(float latitude, float longitude) throws org.json.JSONException
org.json.JSONException
public HourlyForecast hourlyForecastFromRawResponse(java.lang.String response) throws org.json.JSONException
org.json.JSONException
public DailyForecast dailyForecastByCityName(java.lang.String cityName, byte count) throws java.io.IOException, org.json.JSONException
java.io.IOException
org.json.JSONException
public DailyForecast dailyForecastByCityName(java.lang.String cityName, java.lang.String countryCode, byte count) throws java.io.IOException, org.json.JSONException
java.io.IOException
org.json.JSONException
public DailyForecast dailyForecastByCityCode(long cityCode, byte count) throws org.json.JSONException
org.json.JSONException
public DailyForecast dailyForecastByCoordinates(float latitude, float longitude, byte count) throws org.json.JSONException
org.json.JSONException
public DailyForecast dailyForecastFromRawResponse(java.lang.String response) throws org.json.JSONException
org.json.JSONException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |