SparseArrayKt

public final class SparseArrayKt


Summary

Public fields

final int

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

Public methods

static final boolean
<T extends Object> SparseArrayKt.contains(
    @NonNull SparseArray<@NonNull T> receiver,
    int key
)

Returns true if the collection contains key.

static final boolean
<T extends Object> SparseArrayKt.containsKey(
    @NonNull SparseArray<@NonNull T> receiver,
    int key
)

Returns true if the collection contains key.

static final boolean
<T extends Object> SparseArrayKt.containsValue(
    @NonNull SparseArray<@NonNull T> receiver,
    @NonNull T value
)

Returns true if the collection contains value.

static final void
<T extends Object> SparseArrayKt.forEach(
    @NonNull SparseArray<@NonNull T> receiver,
    @NonNull Function2<@NonNull Integer, @NonNull value, Unit> action
)

Performs the given action for each key/value entry.

static final @NonNull T
<T extends Object> SparseArrayKt.getOrDefault(
    @NonNull SparseArray<@NonNull T> receiver,
    int key,
    @NonNull T defaultValue
)

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

static final @NonNull T
<T extends Object> SparseArrayKt.getOrElse(
    @NonNull SparseArray<@NonNull T> receiver,
    int key,
    @NonNull Function0<@NonNull T> defaultValue
)

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

static final boolean
<T extends Object> SparseArrayKt.isEmpty(@NonNull SparseArray<@NonNull T> receiver)

Return true when the collection contains no elements.

static final boolean
<T extends Object> SparseArrayKt.isNotEmpty(
    @NonNull SparseArray<@NonNull T> receiver
)

Return true when the collection contains elements.

static final @NonNull IntIterator
<T extends Object> SparseArrayKt.keyIterator(
    @NonNull SparseArray<@NonNull T> receiver
)

Return an iterator over the collection's keys.

static final @NonNull SparseArray<@NonNull T>
<T extends Object> SparseArrayKt.plus(
    @NonNull SparseArray<@NonNull T> receiver,
    @NonNull SparseArray<@NonNull T> other
)

Creates a new collection by adding or replacing entries from other.

static final void
<T extends Object> SparseArrayKt.putAll(
    @NonNull SparseArray<@NonNull T> receiver,
    @NonNull SparseArray<@NonNull T> other
)

Update this collection by adding or replacing entries from other.

static final boolean
<T extends Object> SparseArrayKt.remove(
    @NonNull SparseArray<@NonNull T> receiver,
    int key,
    @NonNull T value
)

Removes the entry for key only if it is mapped to value.

static final void
<T extends Object> SparseArrayKt.set(
    @NonNull SparseArray<@NonNull T> receiver,
    int key,
    @NonNull T value
)

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

static final @NonNull Iterator<@NonNull T>
<T extends Object> SparseArrayKt.valueIterator(
    @NonNull SparseArray<@NonNull T> receiver
)

Return an iterator over the collection's values.

Public fields

size

@NonNull
public final int size

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

Public methods

SparseArrayKt.contains

@NonNull
public static final boolean <T extends Object> SparseArrayKt.contains(
    @NonNull SparseArray<@NonNull T> receiver,
    int key
)

Returns true if the collection contains key.

SparseArrayKt.containsKey

@NonNull
public static final boolean <T extends Object> SparseArrayKt.containsKey(
    @NonNull SparseArray<@NonNull T> receiver,
    int key
)

Returns true if the collection contains key.

SparseArrayKt.containsValue

@NonNull
public static final boolean <T extends Object> SparseArrayKt.containsValue(
    @NonNull SparseArray<@NonNull T> receiver,
    @NonNull T value
)

Returns true if the collection contains value.

SparseArrayKt.forEach

@NonNull
public static final void <T extends Object> SparseArrayKt.forEach(
    @NonNull SparseArray<@NonNull T> receiver,
    @NonNull Function2<@NonNull Integer, @NonNull value, Unit> action
)

Performs the given action for each key/value entry.

SparseArrayKt.getOrDefault

@NonNull
public static final T <T extends Object> SparseArrayKt.getOrDefault(
    @NonNull SparseArray<@NonNull T> receiver,
    int key,
    @NonNull T defaultValue
)

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

SparseArrayKt.getOrElse

@NonNull
public static final T <T extends Object> SparseArrayKt.getOrElse(
    @NonNull SparseArray<@NonNull T> receiver,
    int key,
    @NonNull Function0<@NonNull T> defaultValue
)

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

SparseArrayKt.isEmpty

@NonNull
public static final boolean <T extends Object> SparseArrayKt.isEmpty(@NonNull SparseArray<@NonNull T> receiver)

Return true when the collection contains no elements.

SparseArrayKt.isNotEmpty

@NonNull
public static final boolean <T extends Object> SparseArrayKt.isNotEmpty(
    @NonNull SparseArray<@NonNull T> receiver
)

Return true when the collection contains elements.

SparseArrayKt.keyIterator

@NonNull
public static final IntIterator <T extends Object> SparseArrayKt.keyIterator(
    @NonNull SparseArray<@NonNull T> receiver
)

Return an iterator over the collection's keys.

SparseArrayKt.plus

@NonNull
public static final SparseArray<@NonNull T> <T extends Object> SparseArrayKt.plus(
    @NonNull SparseArray<@NonNull T> receiver,
    @NonNull SparseArray<@NonNull T> other
)

Creates a new collection by adding or replacing entries from other.

SparseArrayKt.putAll

@NonNull
public static final void <T extends Object> SparseArrayKt.putAll(
    @NonNull SparseArray<@NonNull T> receiver,
    @NonNull SparseArray<@NonNull T> other
)

Update this collection by adding or replacing entries from other.

SparseArrayKt.remove

@NonNull
public static final boolean <T extends Object> SparseArrayKt.remove(
    @NonNull SparseArray<@NonNull T> receiver,
    int key,
    @NonNull T value
)

Removes the entry for key only if it is mapped to value.

SparseArrayKt.set

@NonNull
public static final void <T extends Object> SparseArrayKt.set(
    @NonNull SparseArray<@NonNull T> receiver,
    int key,
    @NonNull T value
)

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

SparseArrayKt.valueIterator

@NonNull
public static final Iterator<@NonNull T> <T extends Object> SparseArrayKt.valueIterator(
    @NonNull SparseArray<@NonNull T> receiver
)

Return an iterator over the collection's values.