Country

public class Country extends Place

A Country is a specific kind of Place that stores the ID and name of a country. No instance field should ever be set to Place.NOWHERE.

Fields

isoA2

public String isoA2

2-Letter ISO country code. This is not currently used.

name

public String name

Name of country

Constructors

Country

public Country(long id, String name, Point latLng, long population, String featureCode, String isoA2)

Initialize instance fields and those of superclass with provided parameters

Parameters:
  • id – ID of country
  • name – Name of country
  • latLng – Latitude and longitude coordinates of the region
  • population – Population of the region
  • featureCode – Region’s feature code
  • isoA2 – 2-Letter ISO country code

Country

public Country(JSONObject json)

Initialize instance fields and those of superclass based on provided JSON It requires that the key name exist, as its value will be used as the country’s name

Parameters:
  • json – JSON object describing the country to create
Throws:
  • JSONException – May be thrown in response to invalid JSON object

Country

public Country()

Empty constructor for database use only. This should never be called by our code.

Methods

getFullName

public String getFullName()

Get name of country, which is suitable for display in UI.

Returns:Name of country, abbreviated if necessary to have a maximum length of org.codethechange.culturemesh.Listable.MAX_CHARS.

See also: org.codethechange.culturemesh.Listable

getName

public String getName()

Get name of country

Returns:Name of country

getShortName

public String getShortName()

Now display just country name.

toString

public String toString()

Represent the object as a string suitable for debugging, but not for display to user.

Returns:String representation of the form Class[var=value, var=value, var=value, ...]