|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.oopitis.weather.GeoLocation
com.oopitis.weather.owm.OwmLocation
public class OwmLocation
The type of location objects for querying Open Weather Map weather data.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.oopitis.weather.GeoLocation |
|---|
GeoLocation.Coordinates |
| Constructor Summary | |
|---|---|
OwmLocation(float latitude,
float longitude)
Constructs a location with a pair of geographic coordinates. |
|
OwmLocation(long id)
Constructs a location with a city ID. |
|
OwmLocation(java.lang.String city)
Constructs a location with a city name. |
|
OwmLocation(java.lang.String city,
java.util.Locale country)
Constructs a location with a city and the country it belongs to. |
|
OwmLocation(java.lang.String city,
java.lang.String county)
Constructs a location with a city and the county it belongs to. |
|
| Method Summary | |
|---|---|
java.lang.String |
toString()
Returns a string representation of this location. |
static java.lang.String |
toUrlQuery(GeoLocation loc)
Constructs the URL query string for a GeoLocation object. |
| Methods inherited from class com.oopitis.weather.GeoLocation |
|---|
formatCoordinate, getCity, getCoordinates, getId, getLocale, getRegion, getZipCode, newCoordinates |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OwmLocation(long id)
id - the city ID
java.lang.NullPointerException - if the given ID is nullpublic OwmLocation(java.lang.String city)
city - the name of the city
java.lang.NullPointerException - if the given city name is null
public OwmLocation(java.lang.String city,
java.lang.String county)
city - the citycounty - the county that contains the city
java.lang.NullPointerException - if the given city is null
public OwmLocation(java.lang.String city,
java.util.Locale country)
city - the citycountry - a locale of the country. Only the country code of the
locale is used.
java.lang.NullPointerException - if the given city is null
public OwmLocation(float latitude,
float longitude)
latitude - the latitudelongitude - the longitude
java.lang.IllegalArgumentException - if the latitude or longitude is out
of range| Method Detail |
|---|
public static java.lang.String toUrlQuery(GeoLocation loc)
GeoLocation object.
The choice of identification is in the following order:
loc - the GeoLocation object
public java.lang.String toString()
GeoLocation
toString in class GeoLocation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||