StructuredSearchSession

A session represents the current state of the structured search process.

The search proceeds as a series of steps and intermediate searches until the client reaches the destination address.

  1. The session starts with the fetchStructuredSearchState call, which returns the initial state.

  2. Then, the client can select a candidate in the current step with the selectCandidate call. (Optional) 3. After proceeding with the search, the client can go back to the previous step with the goBack call.

Here is a flow to get to the house address using Structured Search:

  • prefecture/metropolitan -> municipality -> oaza -> chome/aza -> (gaiku-)houseNumber(-sub) For example:

  • "Japan" -> "Saitama Prefecture" -> "Saitama City Minami Ward" -> "Negishi" -> "5 chome" -> "2-13-3"

See also

for more information.

Functions

Link copied to clipboard

Perform a synchronous action to fetch the current structured search state. This can be used to retrieve the initial state with candidates representing the top level of address, such as country.

abstract fun fetchStructuredSearchState(structuredSearchCallback: StructuredSearchCallback): Cancellable

Perform an asynchronous action to fetch the current structured search state. This can be used to retrieve the initial state with candidates representing the top level of address, such as country.

Link copied to clipboard

Perform a synchronous action to go back to previous selection from current step. step must be a positive value. If step is larger than the number of steps that have been taken, e.g. goBack is called with step set to 9 at the third step, it goes back to the first step.

abstract fun goBack(@IntRange(from = 1) step: Int = 1, structuredSearchCallback: StructuredSearchCallback): Cancellable

Perform an asynchronous action to go back to previous selection from current step. step must be a positive value. If step is larger than the number of steps that have been taken, e.g. goBack is called with step set to 9 at the third step, it goes back to the first step.

Link copied to clipboard

Perform a synchronous action to select a specific candidate in the current step. This will advance to the next step of the search path.

abstract fun selectCandidate(candidate: StructuredSearchCandidate, structuredSearchCallback: StructuredSearchCallback): Cancellable

Perform an asynchronous action to select a specific candidate in the current step. This will advance to the next step of the search path.

Link copied to clipboard

Perform a synchronous action to set locale for the search session. The locale is used to find the best representation of strings in StructuredSearchCandidate. If the locale is empty, e.g. Locale.ROOT, the session locale remains the same.

abstract fun setLocale(locale: Locale, structuredSearchCallback: StructuredSearchCallback): Cancellable

Perform an asynchronous action to set locale for the search session. The locale is used to find the best representation of strings in StructuredSearchCandidate. If the locale is empty, e.g. Locale.ROOT, the session locale remains the same.

Inherited functions

Link copied to clipboard
abstract fun close()