public class

PackageManagerGeocodingService

extends GeocodingService
java.lang.Object
   ↳ com.carto.geocoding.GeocodingService
     ↳ com.carto.geocoding.PackageManagerGeocodingService

Class Overview

A geocoding service that uses geocoding packages from package manager.

Summary

Public Constructors
PackageManagerGeocodingService(PackageManager packageManager)
Constructs a new instance of the PackageManagerGeocodingService given package manager instance.
Public Methods
GeocodingResultVector calculateAddresses(GeocodingRequest request)
Calculates matching addresses from the specified geocoding request.
synchronized void delete()
String getLanguage()
Returns the language of the expected results.
int getMaxResults()
Returns the maximum number of results the geocoding service returns.
boolean isAutocomplete()
Returns the autocomplete flag of the service.
void setAutocomplete(boolean autocomplete)
Sets the autocomplete flag of the service.
void setLanguage(String lang)
Sets the language of the expected results.
void setMaxResults(int maxResults)
Sets the maximum number of results the geocoding service returns.
[Expand]
Inherited Methods
From class com.carto.geocoding.GeocodingService
From class java.lang.Object

Public Constructors

public PackageManagerGeocodingService (PackageManager packageManager)

Constructs a new instance of the PackageManagerGeocodingService given package manager instance.

Parameters
packageManager The package manager instance to use.

Public Methods

public GeocodingResultVector calculateAddresses (GeocodingRequest request)

Calculates matching addresses from the specified geocoding request.

Parameters
request The geocoding request to use.
Returns
  • The list of matching geocoding results, sorted by descending ranks.
Throws
IOException

public synchronized void delete ()

public String getLanguage ()

Returns the language of the expected results.

Returns
  • The language of the expected results. As ISO 639-1 code or empty string.

public int getMaxResults ()

Returns the maximum number of results the geocoding service returns.

Returns
  • The maximum number of results the geocoding service returns.

public boolean isAutocomplete ()

Returns the autocomplete flag of the service.

Returns
  • The autocomplete flag of the service.

public void setAutocomplete (boolean autocomplete)

Sets the autocomplete flag of the service.
By default this flag is off.

Parameters
autocomplete The new value for autocomplete flag.

public void setLanguage (String lang)

Sets the language of the expected results.

Parameters
lang The language to use as ISO 639-1 code. Empty string can be used for default language.

public void setMaxResults (int maxResults)

Sets the maximum number of results the geocoding service returns.
The default number of results is service dependant (normally 10).

Parameters
maxResults The new maximum number of results the geocoding service returns.