NearLocation

public class NearLocation extends DatabaseLocation

Wrapper for DatabaseLocation that is for Near locations. See the documentation for DatabaseLocation for information as to why this redundancy is necessary. All of these instance fields will be stored in the local cached database.

Fields

CITY_ID_KEY

public static final String CITY_ID_KEY

Constant that holds the JSON key whose value will be the ID of the city (City.cityId) in communications with the server.

See also: Location.Location(JSONObject,String,String,String)

COUNTRY_ID_KEY

public static final String COUNTRY_ID_KEY

Constant that holds the JSON key whose value will be the ID of the country (Country.countryId) in communications with the server.

See also: Location.Location(JSONObject,String,String,String)

REGION_ID_KEY

public static final String REGION_ID_KEY

Constant that holds the JSON key whose value will be the ID of the region (Region.regionId) in communications with the server.

See also: Location.Location(JSONObject,String,String,String)

near_city_id

public long near_city_id

Mirrors the Location.cityId in Location to avoid collisions in the database

See also: DatabaseLocation

near_country_id

public long near_country_id

Mirrors the Location.countryId in Location to avoid collisions in the database

See also: DatabaseLocation

near_region_id

public long near_region_id

Mirrors the Location.regionId in Location to avoid collisions in the database

See also: DatabaseLocation

Constructors

NearLocation

public NearLocation(long cityId, long regionId, long countryId)

Initialize instance fields with provided parameters

Parameters:
  • cityId – ID of city
  • regionId – ID of region
  • countryId – ID of country

NearLocation

public NearLocation(JSONObject json)

Initializes instance fields by passing JSON to Location.Location(JSONObject,String,String,String) and then initializing instance fields using NearLocation.initialize()

Parameters:
  • json – JSON object describing the location
Throws:
  • JSONException – May be thrown in response to improperly formatted JSON

NearLocation

public NearLocation(JSONObject json, boolean distinguisher)

Initializes instance fields by passing JSON to Location.Location(JSONObject) and then initializing instance fields using NearLocation.initialize()

Parameters:
Throws:
  • JSONException – May be thrown in response to improperly formatted JSON

NearLocation

public NearLocation()

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