LongSparseArrayKt
public final class LongSparseArrayKt
Summary
Public methods |
|
|---|---|
static final boolean |
<T extends Object> contains(@NonNull LongSparseArray<@NonNull T> receiver, long key)Returns true if the collection contains |
static final boolean |
<T extends Object> containsKey(Returns true if the collection contains |
static final boolean |
<T extends Object> containsValue(Returns true if the collection contains |
static final void |
<T extends Object> forEach(Performs the given |
static final @NonNull T |
<T extends Object> getOrDefault(Return the value corresponding to |
static final @NonNull T |
<T extends Object> getOrElse(Return the value corresponding to |
static final int |
getSize(@NonNull LongSparseArray<@NonNull T> receiver)Returns the number of key/value pairs in the collection. |
static final boolean |
<T extends Object> isEmpty(@NonNull LongSparseArray<@NonNull T> receiver)Return true when the collection contains no elements. |
static final boolean |
<T extends Object> isNotEmpty(@NonNull LongSparseArray<@NonNull T> receiver)Return true when the collection contains elements. |
static final @NonNull LongIterator |
<T extends Object> keyIterator(@NonNull LongSparseArray<@NonNull T> receiver)Return an iterator over the collection's keys. |
static final @NonNull LongSparseArray<@NonNull T> |
<T extends Object> plus(Creates a new collection by adding or replacing entries from |
static final void |
<T extends Object> putAll(Update this collection by adding or replacing entries from |
static final boolean |
|
static final void |
Allows the use of the index operator for storing values in the collection. |
static final @NonNull Iterator<@NonNull T> |
<T extends Object> valueIterator(@NonNull LongSparseArray<@NonNull T> receiver)Return an iterator over the collection's values. |
Public methods
contains
public static final boolean <T extends Object> contains(@NonNull LongSparseArray<@NonNull T> receiver, long key)
Returns true if the collection contains key.
containsKey
public static final boolean <T extends Object> containsKey(
@NonNull LongSparseArray<@NonNull T> receiver,
long key
)
Returns true if the collection contains key.
containsValue
public static final boolean <T extends Object> containsValue(
@NonNull LongSparseArray<@NonNull T> receiver,
@NonNull T value
)
Returns true if the collection contains value.
forEach
public static final void <T extends Object> forEach(
@NonNull LongSparseArray<@NonNull T> receiver,
@NonNull Function2<@NonNull Long, @NonNull value, Unit> action
)
Performs the given action for each key/value entry.
getOrDefault
public static final @NonNull T <T extends Object> getOrDefault(
@NonNull LongSparseArray<@NonNull T> receiver,
long key,
@NonNull T defaultValue
)
Return the value corresponding to key, or defaultValue when not present.
getOrElse
public static final @NonNull T <T extends Object> getOrElse(
@NonNull LongSparseArray<@NonNull T> receiver,
long key,
@NonNull Function0<@NonNull T> defaultValue
)
Return the value corresponding to key, or from defaultValue when not present.
getSize
public static final int getSize(@NonNull LongSparseArray<@NonNull T> receiver)
Returns the number of key/value pairs in the collection.
isEmpty
public static final boolean <T extends Object> isEmpty(@NonNull LongSparseArray<@NonNull T> receiver)
Return true when the collection contains no elements.
isNotEmpty
public static final boolean <T extends Object> isNotEmpty(@NonNull LongSparseArray<@NonNull T> receiver)
Return true when the collection contains elements.
keyIterator
public static final @NonNull LongIterator <T extends Object> keyIterator(@NonNull LongSparseArray<@NonNull T> receiver)
Return an iterator over the collection's keys.
plus
public static final @NonNull LongSparseArray<@NonNull T> <T extends Object> plus(
@NonNull LongSparseArray<@NonNull T> receiver,
@NonNull LongSparseArray<@NonNull T> other
)
Creates a new collection by adding or replacing entries from other.
putAll
public static final void <T extends Object> putAll(
@NonNull LongSparseArray<@NonNull T> receiver,
@NonNull LongSparseArray<@NonNull T> other
)
Update this collection by adding or replacing entries from other.
remove
public static final boolean <T extends Object> remove(
@NonNull LongSparseArray<@NonNull T> receiver,
long key,
@NonNull T value
)
set
public static final void <T extends Object> set(
@NonNull LongSparseArray<@NonNull T> receiver,
long key,
@NonNull T value
)
Allows the use of the index operator for storing values in the collection.
valueIterator
public static final @NonNull Iterator<@NonNull T> <T extends Object> valueIterator(@NonNull LongSparseArray<@NonNull T> receiver)
Return an iterator over the collection's values.