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