Sector

Creates a new Sector instance.

Author

Arnau Mora

Since

20210724

Constructors

Link copied to clipboard
fun Sector(data: JSONObject, sectorId: String, childrenCount: Long)

Creates a new Sector from the data of the Data Module. Note: This doesn't add children

Types

Link copied to clipboard

Functions

Link copied to clipboard
open override fun data(): SectorData

Converts the DataClass into a Search Data class.

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
open override fun displayMap(): Map<String, Serializable?>

Returns a map used to display the stored data to the user. Keys should be the parameter name, and the value the value to display. Should be overridden by target class.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Checks if the DataClass is the same as another one.

Link copied to clipboard
suspend fun get(context: Context, index: Int): Path

Gets the children element at index. May throw IndexOutOfBoundsException if children have not been loaded.

suspend fun get(context: Context, objectId: String): Path?

Finds an DataClass inside a list with an specific id. If it's not found, null is returned.

Link copied to clipboard
inline suspend fun <R : Comparable<R>> getChildren(context: Context, crossinline sortBy: (Path) -> R?): List<Path>

Returns the children of the DataClass.

Link copied to clipboard
suspend fun getCount(context: Context): Int

Returns the amount of children the DataClass has.

Link copied to clipboard
suspend fun <D : DataClass<*, *, *>> getParent(context: Context): D?

Gets the parent element of the DataClass.

Link copied to clipboard
suspend fun getSize(context: Context): Int

Returns the amount of children the DataClass has.

Link copied to clipboard
suspend fun has(context: Context, objectId: String): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Checks if the DataClass has a stored downloadUrl.

Link copied to clipboard
fun Image(modifier: Modifier = Modifier, imageLoadParameters: ImageLoadParameters? = null, isPlaceholder: Boolean = false, onFinishLoading: () -> Unit)
Link copied to clipboard
fun imageFile(context: Context): File?

Returns the File that represents the image of the DataClass

Link copied to clipboard
suspend fun isEmpty(context: Context): Boolean

Checks if the data class has children. Note: won't load children, will just use the already loaded ones.

Link copied to clipboard
suspend fun isNotEmpty(context: Context): Boolean

Checks if the data class doesn't have any children

Link copied to clipboard
suspend fun kmzFile(context: Context, permanent: Boolean): File

Gets the KMZ file path. If it has never been loaded, it gets loaded from the server. Otherwise, it gets loaded from cache.

Link copied to clipboard
open override fun toString(): String

Converts the DataClass to a String for showing in debug or to the user. The string contains the first letter of the namespace, followed by a slash (/) and the objectId.

Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)

Properties

Link copied to clipboard
open override val displayName: String

The name that will be displayed to the user.

Link copied to clipboard

Options for displaying in the UI.

Link copied to clipboard

The download url from Firebase Storage for the DataClass' image.

Link copied to clipboard
open override val hasParents: Boolean = true

Tells whether or not the DataClass has parent elements, or if it's root. Used in functions such as getParent to be quicker.

Link copied to clipboard
open override val imagePath: String

The path of the DataClass' image on the server.

Link copied to clipboard
Link copied to clipboard
open val kmzPath: String?

The path of the DataClass' KMZ file on the server. May be null if not applicable or non-existing.

Link copied to clipboard
open override val location: GeoPoint?

The coordinates of the DataClass to show in a map.

Link copied to clipboard

Some metadata of the DataClass.

Link copied to clipboard
Link copied to clipboard
open override val objectId: String
Link copied to clipboard
val pin: String

Provides a generic name for the DataClass.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val timestampMillis: Long

The creation date of the DataClass in milliseconds.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard