LongSparseArrayKt

public final class LongSparseArrayKt


Summary

Public fields

final int

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

Public methods

static final @RequiresApi(value = 16) boolean
<T extends Object> LongSparseArrayKt.contains(
    LongSparseArray<T> receiver,
    long key
)

Returns true if the collection contains key.

static final @RequiresApi(value = 16) boolean
<T extends Object> LongSparseArrayKt.containsKey(
    LongSparseArray<T> receiver,
    long key
)

Returns true if the collection contains key.

static final @RequiresApi(value = 16) boolean
<T extends Object> LongSparseArrayKt.containsValue(
    LongSparseArray<T> receiver,
    T value
)

Returns true if the collection contains value.

static final @RequiresApi(value = 16) void
<T extends Object> LongSparseArrayKt.forEach(
    LongSparseArray<T> receiver,
    Function2<Long, value, Unit> action
)

Performs the given action for each key/value entry.

static final @RequiresApi(value = 16) @NonNull T
<T extends Object> LongSparseArrayKt.getOrDefault(
    LongSparseArray<T> receiver,
    long key,
    T defaultValue
)

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

static final @RequiresApi(value = 16) @NonNull T
<T extends Object> LongSparseArrayKt.getOrElse(
    LongSparseArray<T> receiver,
    long key,
    Function0<T> defaultValue
)

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

static final @RequiresApi(value = 16) boolean
<T extends Object> LongSparseArrayKt.isEmpty(LongSparseArray<T> receiver)

Return true when the collection contains no elements.

static final @RequiresApi(value = 16) boolean

Return true when the collection contains elements.

static final @RequiresApi(value = 16) @NonNull LongIterator

Return an iterator over the collection's keys.

static final @RequiresApi(value = 16) @NonNull LongSparseArray<@NonNull T>
<T extends Object> LongSparseArrayKt.plus(
    LongSparseArray<T> receiver,
    LongSparseArray<T> other
)

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

static final @RequiresApi(value = 16) void
<T extends Object> LongSparseArrayKt.putAll(
    LongSparseArray<T> receiver,
    LongSparseArray<T> other
)

Update this collection by adding or replacing entries from other.

static final @RequiresApi(value = 16) boolean
<T extends Object> LongSparseArrayKt.remove(
    LongSparseArray<T> receiver,
    long key,
    T value
)

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

static final @RequiresApi(value = 16) void
<T extends Object> LongSparseArrayKt.set(
    LongSparseArray<T> receiver,
    long key,
    T value
)

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

static final @RequiresApi(value = 16) @NonNull Iterator<@NonNull T>

Return an iterator over the collection's values.

Public fields

size

public final int size

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

Public methods

LongSparseArrayKt.contains

@RequiresApi(value = 16)
public static final boolean <T extends Object> LongSparseArrayKt.contains(
    LongSparseArray<T> receiver,
    long key
)

Returns true if the collection contains key.

LongSparseArrayKt.containsKey

@RequiresApi(value = 16)
public static final boolean <T extends Object> LongSparseArrayKt.containsKey(
    LongSparseArray<T> receiver,
    long key
)

Returns true if the collection contains key.

LongSparseArrayKt.containsValue

@RequiresApi(value = 16)
public static final boolean <T extends Object> LongSparseArrayKt.containsValue(
    LongSparseArray<T> receiver,
    T value
)

Returns true if the collection contains value.