{% setvar book_path %}/reference/kotlin/commonMain/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

androidx.collection

Interfaces

FooSparseArray

SparseArray mapping longs to Objects.

Cmn

Extension functions summary

inline operator Boolean
<T : Any?> FooSparseArray<T>.contains(key: Long)

Returns true if the collection contains key.

Cmn
inline Unit
<T : Any?> FooSparseArray<T>.forEach(action: (key: Long, value) -> Unit)

Performs the given action for each key/value entry.

Cmn
inline T
<T : Any?> FooSparseArray<T>.getOrDefault(key: Long, defaultValue: T)

Return the value corresponding to key, or defaultValue when not present.

Cmn
inline T
<T : Any?> FooSparseArray<T>.getOrElse(key: Long, defaultValue: () -> T)

Return the value corresponding to key, or from defaultValue when not present.

Cmn
inline Boolean

Return true when the collection contains elements.

Cmn
LongIterator

Return an iterator over the collection's keys.

Cmn
inline operator Unit
<T : Any?> FooSparseArray<T>.set(key: Long, value: T)

Allows the use of the index operator for storing values in the collection.

Cmn
Iterator<T>

Return an iterator over the collection's values.

Cmn

Extension properties summary

Int

Returns the number of key/value pairs in the collection.

Cmn

Extension functions

contains

inline operator fun <T : Any?> FooSparseArray<T>.contains(key: Long): Boolean

Returns true if the collection contains key.

forEach

inline fun <T : Any?> FooSparseArray<T>.forEach(action: (key: Long, value) -> Unit): Unit

Performs the given action for each key/value entry.

getOrDefault

inline fun <T : Any?> FooSparseArray<T>.getOrDefault(key: Long, defaultValue: T): T

Return the value corresponding to key, or defaultValue when not present.

getOrElse

inline fun <T : Any?> FooSparseArray<T>.getOrElse(key: Long, defaultValue: () -> T): T

Return the value corresponding to key, or from defaultValue when not present.

isNotEmpty

inline fun <T : Any?> FooSparseArray<T>.isNotEmpty(): Boolean

Return true when the collection contains elements.

keyIterator

fun <T : Any?> FooSparseArray<T>.keyIterator(): LongIterator

Return an iterator over the collection's keys.

set

inline operator fun <T : Any?> FooSparseArray<T>.set(key: Long, value: T): Unit

Allows the use of the index operator for storing values in the collection.

valueIterator

fun <T : Any?> FooSparseArray<T>.valueIterator(): Iterator<T>

Return an iterator over the collection's values.

Extension properties

size

val FooSparseArray<T>.sizeInt

Returns the number of key/value pairs in the collection.