Region¶
-
public class
Region
extends Place¶ A
Region
is a specific kind ofPlace
that stores the ID and name of a region. It can also store the name and ID of the region’s country, but this is not mandatory. If any geographical descriptor (e.g. city, region, or country) is not specified, its name will be stored asPlace.NOWHERE
, but this constant should not be used by clients. Note that theregion
descriptor is mandatory.
Fields¶
countryName¶
-
public String
countryName
¶ Name of the country (may store
Place.NOWHERE
regionName¶
-
public String
regionName
¶ Name of the region (should always be specified and not as
Place.NOWHERE
Constructors¶
Region¶
-
public
Region
(long regionId, long countryId, String regionName, String countryName, Point latLng, long population, String featureCode)¶ Initialize instance fields and those of superclass with provided parameters No parameters should be set to
Place.NOWHERE
orLocation.NOWHERE
For regions with explicitly specified countriesParameters: - regionId – ID of region
- countryId – ID of country
- regionName – Name of region
- countryName – Name of country
- latLng – Latitude and longitude coordinates of the region
- population – Population of the region
- featureCode – Region’s feature code
Region¶
-
public
Region
(long regionId, String regionName, Point latLng, long population, String featureCode)¶ Initialize instance fields and those of superclass with provided parameters No parameters should be set to
Place.NOWHERE
orLocation.NOWHERE
For regions that have no specified countryParameters: - regionId – ID of region
- regionName – Name of region
- latLng – Latitude and longitude coordinates of the region
- population – Population of the region
- featureCode – Region’s feature code
Region¶
-
public
Region
(JSONObject json)¶ Initialize instance fields and those of superclass based on provided JSON This class extracts the following fields, if they are present:
country_name
. It requires that the keyname
exist, as its value will be used as the region’s nameParameters: - json – JSON object describing the region to create
Throws: - JSONException – May be thrown in response to an invalidly formatted JSON object
Methods¶
getFullName¶
-
public String
getFullName
()¶ Get a name for the region that lists all available geographic descriptor names. For example,
Washington, D.C.
would be expressed asWashington, D.C., United States
, whileSan Francisco
would be expressed asSan Francisco, California, United States
.Returns: Name of city that includes all available geographic descriptors