AdministrativeUnitDataSource

Interface representing a data source for managing AdministrativeUnit objects. This data source could be local storage, a remote server, or another solution for storing administrative unit data.

Inheritors

Functions

Link copied to clipboard
abstract fun retrieve(): Flow<List<AdministrativeUnit>>

Retrieves a stream (Flow) of all AdministrativeUnit objects from the data source.

abstract fun retrieve(administrativeLevel: AdministrativeLevel): Flow<List<AdministrativeUnit>>

Retrieves a stream (Flow) of AdministrativeUnit objects filtered by the provided administrativeLevel.

Link copied to clipboard
abstract fun retrieveActiveRegionsWithin(boundingBox: BoundingBox): Flow<List<Region>>

Retrieves a stream (Flow) of Region objects that are located entirely within the specified boundingBox. By default, this method retrieves active regions, however the definition of "active" might depend on the specific implementation.

Link copied to clipboard
abstract fun retrieveCurrent(): Flow<AdministrativeUnit>

Retrieves a stream (Flow) of the currently selected AdministrativeUnit object. The Flow will emit whenever the selected unit changes.

Link copied to clipboard
abstract fun updateCurrentIndex(index: Int)

Updates the currently selected AdministrativeUnit based on the provided index. The behavior depends on the implementation, but it's typically assumed that the index corresponds to the order in which units were retrieved using methods like retrieve or retrieveByLevel.