| <html devsite="true"> |
| <head> |
| <title>SparseArrayCompat</title> |
| {% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} |
| {% include "_shared/_reference-head-tags.html" %} |
| </head> |
| <body> |
| <div itemscope="" itemtype="http://developers.google.com/ReferenceObject"> |
| <meta itemprop="name" content="SparseArrayCompat"> |
| <meta itemprop="path" content="androidx.collection"> |
| <meta itemprop="property" content="append(kotlin.Int,kotlin.Any)"> |
| <meta itemprop="property" content="clear()"> |
| <meta itemprop="property" content="clone()"> |
| <meta itemprop="property" content="containsKey(kotlin.Int)"> |
| <meta itemprop="property" content="containsValue(kotlin.Any)"> |
| <meta itemprop="property" content="delete(kotlin.Int)"> |
| <meta itemprop="property" content="get(kotlin.Int)"> |
| <meta itemprop="property" content="get(kotlin.Int,kotlin.Any)"> |
| <meta itemprop="property" content="getIsEmpty()"> |
| <meta itemprop="property" content="indexOfKey(kotlin.Int)"> |
| <meta itemprop="property" content="indexOfValue(kotlin.Any)"> |
| <meta itemprop="property" content="isEmpty()"> |
| <meta itemprop="property" content="keyAt(kotlin.Int)"> |
| <meta itemprop="property" content="put(kotlin.Int,kotlin.Any)"> |
| <meta itemprop="property" content="putAll(androidx.collection.SparseArrayCompat)"> |
| <meta itemprop="property" content="putIfAbsent(kotlin.Int,kotlin.Any)"> |
| <meta itemprop="property" content="remove(kotlin.Int)"> |
| <meta itemprop="property" content="remove(kotlin.Int,kotlin.Any)"> |
| <meta itemprop="property" content="removeAt(kotlin.Int)"> |
| <meta itemprop="property" content="removeAtRange(kotlin.Int,kotlin.Int)"> |
| <meta itemprop="property" content="replace(kotlin.Int,kotlin.Any)"> |
| <meta itemprop="property" content="replace(kotlin.Int,kotlin.Any,kotlin.Any)"> |
| <meta itemprop="property" content="setValueAt(kotlin.Int,kotlin.Any)"> |
| <meta itemprop="property" content="size()"> |
| <meta itemprop="property" content="toString()"> |
| <meta itemprop="property" content="valueAt(kotlin.Int)"> |
| <meta itemprop="property" content="(androidx.collection.SparseArrayCompat).contains(kotlin.Int)"> |
| <meta itemprop="property" content="(androidx.collection.SparseArrayCompat).forEach(kotlin.Function2)"> |
| <meta itemprop="property" content="(androidx.collection.SparseArrayCompat).getOrDefault(kotlin.Int,kotlin.Any)"> |
| <meta itemprop="property" content="(androidx.collection.SparseArrayCompat).getOrElse(kotlin.Int,kotlin.Function0)"> |
| <meta itemprop="property" content="(androidx.collection.SparseArrayCompat).getSize()"> |
| <meta itemprop="property" content="(androidx.collection.SparseArrayCompat).isNotEmpty()"> |
| <meta itemprop="property" content="(androidx.collection.SparseArrayCompat).keyIterator()"> |
| <meta itemprop="property" content="(androidx.collection.SparseArrayCompat).plus(androidx.collection.SparseArrayCompat)"> |
| <meta itemprop="property" content="(androidx.collection.SparseArrayCompat).set(kotlin.Int,kotlin.Any)"> |
| <meta itemprop="property" content="(androidx.collection.SparseArrayCompat).valueIterator()"> |
| <meta itemprop="language" content="JAVA"> |
| </div> |
| <div id="header-block"> |
| <div> |
| <h1>SparseArrayCompat</h1> |
| </div> |
| <div id="metadata-info-block"> |
| <div id="source-link"><a href="https://cs.android.com/search?q=file:androidx/collection/SparseArrayCompat.+class:androidx.collection.SparseArrayCompat&ss=androidx/platform/frameworks/support" class="external">View Source</a></div> |
| </div> |
| </div> |
| <div id="refdoc-switcher-placeholder"></div> |
| <p> |
| <pre>public class <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><E extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></pre> |
| </p> |
| <hr> |
| <p>SparseArrays map integers to Objects. Unlike a normal array of Objects, there can be gaps in the indices. It is intended to be more memory efficient than using a HashMap to map Integers to Objects, both because it avoids auto-boxing keys and its data structure doesn't rely on an extra entry object for each mapping.</p> |
| <p>Note that this container keeps its mappings in an array data structure, using a binary search to find keys. The implementation is not intended to be appropriate for data structures that may contain large numbers of items. It is generally slower than a traditional HashMap, since lookups require a binary search and adds and removes require inserting and deleting entries in the array. For containers holding up to hundreds of items, the performance difference is not significant, less than 50%.</p> |
| <p>To help with performance, the container includes an optimization when removing keys: instead of compacting its array immediately, it leaves the removed entry marked as deleted. The entry can then be re-used for the same key, or compacted later in a single garbage collection step of all removed entries. This garbage collection will need to be performed at any time the array needs to be grown or the map size or entry values are retrieved.</p> |
| <p>It is possible to iterate over the items in this container using <code><a href="/reference/androidx/collection/SparseArrayCompat.html#keyAt(kotlin.Int)">keyAt</a></code> and <code><a href="/reference/androidx/collection/SparseArrayCompat.html#valueAt(kotlin.Int)">valueAt</a></code>. Iterating over the keys using <code><a href="/reference/androidx/collection/SparseArrayCompat.html#keyAt(kotlin.Int)">keyAt</a></code> with ascending values of the index will return the keys in ascending order, or the values corresponding to the keys in ascending order in the case of <code><a href="/reference/androidx/collection/SparseArrayCompat.html#valueAt(kotlin.Int)">valueAt</a></code>.</p> |
| <h2>Summary</h2> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Public constructors</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td> |
| <div><code><E extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayCompat.html#SparseArrayCompat(kotlin.Int)">SparseArrayCompat</a>(int initialCapacity)</code></div> |
| <p>Creates a new SparseArray containing no mappings that will not require any additional memory allocation to store the specified number of mappings.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Public methods</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>void</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#append(kotlin.Int,kotlin.Any)">append</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</code></div> |
| <p>Puts a key/value pair into the array, optimizing for the case where the key is greater than all existing keys in the array.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>void</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#clear()">clear</a>()</code></div> |
| <p>Removes all key-value mappings from this SparseArray.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E></code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#clone()">clone</a>()</code></div> |
| </td> |
| </tr> |
| <tr> |
| <td><code>boolean</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#containsKey(kotlin.Int)">containsKey</a>(int key)</code></div> |
| <p>Returns true if the specified key is mapped.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>boolean</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#containsValue(kotlin.Any)">containsValue</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</code></div> |
| <p>Returns true if the specified value is mapped from any key.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>void</code></td> |
| <td> |
| <div><code><span><del><a href="/reference/androidx/collection/SparseArrayCompat.html#delete(kotlin.Int)">delete</a></del></span>(int key)</code></div> |
| <p><strong>This method is deprecated.</strong> Alias for remove(int).</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>E</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#get(kotlin.Int)">get</a>(int key)</code></div> |
| <p>Gets the Object mapped from the specified key, or <code>null</code> if no such mapping has been made.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#get(kotlin.Int,kotlin.Any)">get</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E defaultValue)</code></div> |
| <p>Gets the Object mapped from the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#get(kotlin.Int,kotlin.Any)">key</a></code>, or <code><a href="/reference/androidx/collection/SparseArrayCompat.html#get(kotlin.Int,kotlin.Any)">defaultValue</a></code> if no such mapping has been made.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final boolean</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#getIsEmpty()">getIsEmpty</a>()</code></div> |
| <p>Return true if <code><a href="/reference/androidx/collection/SparseArrayCompat.html#size()">size</a></code> is 0.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>int</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfKey(kotlin.Int)">indexOfKey</a>(int key)</code></div> |
| <p>Returns the index for which <code><a href="/reference/androidx/collection/SparseArrayCompat.html#keyAt(kotlin.Int)">keyAt</a></code> would return the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfKey(kotlin.Int)">key</a></code>, or a negative number if the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfKey(kotlin.Int)">key</a></code> is not mapped.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>int</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfValue(kotlin.Any)">indexOfValue</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</code></div> |
| <p>Returns an index for which <code><a href="/reference/androidx/collection/SparseArrayCompat.html#valueAt(kotlin.Int)">valueAt</a></code> would return the specified key, or a negative number if no keys map to the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfValue(kotlin.Any)">value</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>boolean</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#isEmpty()">isEmpty</a>()</code></div> |
| <p>Return true if <code><a href="/reference/androidx/collection/SparseArrayCompat.html#size()">size</a></code> is 0.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>int</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#keyAt(kotlin.Int)">keyAt</a>(int index)</code></div> |
| <p>Given an index in the range <code>0...size()-1</code>, returns the key from the <code><a href="/reference/androidx/collection/SparseArrayCompat.html#keyAt(kotlin.Int)">index</a></code>th key-value mapping that this SparseArray stores.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>void</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#put(kotlin.Int,kotlin.Any)">put</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</code></div> |
| <p>Adds a mapping from the specified key to the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#put(kotlin.Int,kotlin.Any)">value</a></code>, replacing the previous mapping from the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#put(kotlin.Int,kotlin.Any)">key</a></code> if there was one.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>void</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#putAll(androidx.collection.SparseArrayCompat)">putAll</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E> other)</code></div> |
| <p>Copies all of the mappings from the <code><a href="/reference/androidx/collection/SparseArrayCompat.html#putAll(androidx.collection.SparseArrayCompat)">other</a></code> to this map.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>E</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#putIfAbsent(kotlin.Int,kotlin.Any)">putIfAbsent</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</code></div> |
| <p>Add a new value to the array map only if the key does not already have a value or it is mapped to <code>null</code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>void</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#remove(kotlin.Int)">remove</a>(int key)</code></div> |
| <p>Removes the mapping from the specified key, if there was any.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>boolean</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#remove(kotlin.Int,kotlin.Any)">remove</a>(int key, <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a> value)</code></div> |
| <p>Remove an existing key from the array map only if it is currently mapped to <code><a href="/reference/androidx/collection/SparseArrayCompat.html#remove(kotlin.Int,kotlin.Any)">value</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>void</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#removeAt(kotlin.Int)">removeAt</a>(int index)</code></div> |
| <p>Removes the mapping at the specified index.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>void</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#removeAtRange(kotlin.Int,kotlin.Int)">removeAtRange</a>(int index, int size)</code></div> |
| <p>Remove a range of mappings as a batch.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>E</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#replace(kotlin.Int,kotlin.Any)">replace</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</code></div> |
| <p>Replace the mapping for <code><a href="/reference/androidx/collection/SparseArrayCompat.html#replace(kotlin.Int,kotlin.Any)">key</a></code> only if it is already mapped to a value.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>boolean</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#replace(kotlin.Int,kotlin.Any,kotlin.Any)">replace</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E oldValue, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E newValue)</code></div> |
| <p>Replace the mapping for <code><a href="/reference/androidx/collection/SparseArrayCompat.html#replace(kotlin.Int,kotlin.Any,kotlin.Any)">key</a></code> only if it is already mapped to a value.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>void</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#setValueAt(kotlin.Int,kotlin.Any)">setValueAt</a>(int index, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</code></div> |
| <p>Given an index in the range <code>0...size()-1</code>, sets a new value for the <code><a href="/reference/androidx/collection/SparseArrayCompat.html#setValueAt(kotlin.Int,kotlin.Any)">index</a></code>th key-value mapping that this SparseArray stores.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>int</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#size()">size</a>()</code></div> |
| <p>Returns the number of key-value mappings that this SparseArray currently stores.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a></code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#toString()">toString</a>()</code></div> |
| <p>Returns a string representation of the object.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayCompat.html#valueAt(kotlin.Int)">valueAt</a>(int index)</code></div> |
| <p>Given an index in the range <code>0...size()-1</code>, returns the value from the <code><a href="/reference/androidx/collection/SparseArrayCompat.html#valueAt(kotlin.Int)">index</a></code>th key-value mapping that this SparseArray stores.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Extension functions</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>final boolean</code></td> |
| <td> |
| <div><code><T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).contains(kotlin.Int)">contains</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> int key<br>)</code></div> |
| <p>Returns true if the collection contains <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).contains(kotlin.Int)">key</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final void</code></td> |
| <td> |
| <div><code><T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).forEach(kotlin.Function2)">forEach</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2<@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> value, <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>> action<br>)</code></div> |
| <p>Performs the given <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).forEach(kotlin.Function2)">action</a></code> for each key/value entry.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T</code></td> |
| <td> |
| <div><code><T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).getOrDefault(kotlin.Int,kotlin.Any)">getOrDefault</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> int key,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T defaultValue<br>)</code></div> |
| <p>Return the value corresponding to <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).getOrDefault(kotlin.Int,kotlin.Any)">key</a></code>, or <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).getOrDefault(kotlin.Int,kotlin.Any)">defaultValue</a></code> when not present.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T</code></td> |
| <td> |
| <div><code><T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).getOrElse(kotlin.Int,kotlin.Function0)">getOrElse</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> int key,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function0<@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> defaultValue<br>)</code></div> |
| <p>Return the value corresponding to <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).getOrElse(kotlin.Int,kotlin.Function0)">key</a></code>, or from <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).getOrElse(kotlin.Int,kotlin.Function0)">defaultValue</a></code> when not present.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final int</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).getSize()">getSize</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver)</code></div> |
| <p>Returns the number of key/value pairs in the collection.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final boolean</code></td> |
| <td> |
| <div><code><T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).isNotEmpty()">isNotEmpty</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver<br>)</code></div> |
| <p>Return true when the collection contains elements.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-int-iterator/index.html">IntIterator</a></code></td> |
| <td> |
| <div><code><T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).keyIterator()">keyIterator</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver<br>)</code></div> |
| <p>Return an iterator over the collection's keys.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T></code></td> |
| <td> |
| <div><code><T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).plus(androidx.collection.SparseArrayCompat)">plus</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> other<br>)</code></div> |
| <p>Creates a new collection by adding or replacing entries from <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).plus(androidx.collection.SparseArrayCompat)">other</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final void</code></td> |
| <td> |
| <div><code><T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).set(kotlin.Int,kotlin.Any)">set</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> int key,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T value<br>)</code></div> |
| <p>Allows the use of the index operator for storing values in the collection.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/Iterator.html">Iterator</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T></code></td> |
| <td> |
| <div><code><T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).valueIterator()">valueIterator</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver<br>)</code></div> |
| <p>Return an iterator over the collection's values.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="list"> |
| <h2>Public constructors</h2> |
| <div class="api-item"><a name="SparseArrayCompat-kotlin.Int-"></a><a name="sparsearraycompat"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="SparseArrayCompat(kotlin.Int)">SparseArrayCompat</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public <E extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayCompat.html#SparseArrayCompat(kotlin.Int)">SparseArrayCompat</a>(int initialCapacity)</pre> |
| <p>Creates a new SparseArray containing no mappings that will not require any additional memory allocation to store the specified number of mappings. If you supply an initial capacity of 0, the sparse array will be initialized with a light-weight representation not requiring any additional array allocations.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>int initialCapacity</code></td> |
| <td> |
| <p>initial capacity of the array. The array will not require any additional memory allocation to store the specified number of mappings. If you supply an initialCapacity of 0, the sparse array will be initialized with a light-weight representation not requiring any additional array allocations. Default initialCapacity is 10.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| </div> |
| <div class="list"> |
| <h2>Public methods</h2> |
| <div class="api-item"><a name="append(kotlin.Int, kotlin.Any)"></a><a name="append-kotlin.Int-kotlin.Any-"></a><a name="append"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="append(kotlin.Int,kotlin.Any)">append</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public void <a href="/reference/androidx/collection/SparseArrayCompat.html#append(kotlin.Int,kotlin.Any)">append</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</pre> |
| <p>Puts a key/value pair into the array, optimizing for the case where the key is greater than all existing keys in the array.</p> |
| </div> |
| <div class="api-item"><a name="clear--"></a><a name="clear"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="clear()">clear</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public void <a href="/reference/androidx/collection/SparseArrayCompat.html#clear()">clear</a>()</pre> |
| <p>Removes all key-value mappings from this SparseArray.</p> |
| </div> |
| <div class="api-item"><a name="clone--"></a><a name="clone"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="clone()">clone</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E> <a href="/reference/androidx/collection/SparseArrayCompat.html#clone()">clone</a>()</pre> |
| </div> |
| <div class="api-item"><a name="containsKey-kotlin.Int-"></a><a name="containskey"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="containsKey(kotlin.Int)">containsKey</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public boolean <a href="/reference/androidx/collection/SparseArrayCompat.html#containsKey(kotlin.Int)">containsKey</a>(int key)</pre> |
| <p>Returns true if the specified key is mapped.</p> |
| </div> |
| <div class="api-item"><a name="containsValue-kotlin.Any-"></a><a name="containsvalue"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="containsValue(kotlin.Any)">containsValue</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public boolean <a href="/reference/androidx/collection/SparseArrayCompat.html#containsValue(kotlin.Any)">containsValue</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</pre> |
| <p>Returns true if the specified value is mapped from any key.</p> |
| </div> |
| <div class="api-item"><a name="delete-kotlin.Int-"></a><a name="delete"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="delete(kotlin.Int)">delete</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public void <span><del><a href="/reference/androidx/collection/SparseArrayCompat.html#delete(kotlin.Int)">delete</a></del></span>(int key)</pre> |
| <aside class="caution"><strong>This method is deprecated.</strong><br>Alias for remove(int).</aside> |
| </div> |
| <div class="api-item"><a name="get-kotlin.Int-"></a><a name="get"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="get(kotlin.Int)">get</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public E <a href="/reference/androidx/collection/SparseArrayCompat.html#get(kotlin.Int)">get</a>(int key)</pre> |
| <p>Gets the Object mapped from the specified key, or <code>null</code> if no such mapping has been made.</p> |
| </div> |
| <div class="api-item"><a name="get(kotlin.Int, kotlin.Any)"></a><a name="get-kotlin.Int-kotlin.Any-"></a><a name="get"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="get(kotlin.Int,kotlin.Any)">get</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E <a href="/reference/androidx/collection/SparseArrayCompat.html#get(kotlin.Int,kotlin.Any)">get</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E defaultValue)</pre> |
| <p>Gets the Object mapped from the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#get(kotlin.Int,kotlin.Any)">key</a></code>, or <code><a href="/reference/androidx/collection/SparseArrayCompat.html#get(kotlin.Int,kotlin.Any)">defaultValue</a></code> if no such mapping has been made.</p> |
| </div> |
| <div class="api-item"><a name="getIsEmpty--"></a><a name="getisempty"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="getIsEmpty()">getIsEmpty</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final boolean <a href="/reference/androidx/collection/SparseArrayCompat.html#getIsEmpty()">getIsEmpty</a>()</pre> |
| <p>Return true if <code><a href="/reference/androidx/collection/SparseArrayCompat.html#size()">size</a></code> is 0.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Returns</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>boolean</code></td> |
| <td> |
| <p>true if <code><a href="/reference/androidx/collection/SparseArrayCompat.html#size()">size</a></code> is 0.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="indexOfKey-kotlin.Int-"></a><a name="indexofkey"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="indexOfKey(kotlin.Int)">indexOfKey</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public int <a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfKey(kotlin.Int)">indexOfKey</a>(int key)</pre> |
| <p>Returns the index for which <code><a href="/reference/androidx/collection/SparseArrayCompat.html#keyAt(kotlin.Int)">keyAt</a></code> would return the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfKey(kotlin.Int)">key</a></code>, or a negative number if the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfKey(kotlin.Int)">key</a></code> is not mapped.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>int key</code></td> |
| <td> |
| <p>the key to search for</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Returns</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>int</code></td> |
| <td> |
| <p>the index for which <code><a href="/reference/androidx/collection/SparseArrayCompat.html#keyAt(kotlin.Int)">keyAt</a></code> would return the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfKey(kotlin.Int)">key</a></code>, or a negative number if the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfKey(kotlin.Int)">key</a></code> is not mapped</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="indexOfValue-kotlin.Any-"></a><a name="indexofvalue"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="indexOfValue(kotlin.Any)">indexOfValue</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public int <a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfValue(kotlin.Any)">indexOfValue</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</pre> |
| <p>Returns an index for which <code><a href="/reference/androidx/collection/SparseArrayCompat.html#valueAt(kotlin.Int)">valueAt</a></code> would return the specified key, or a negative number if no keys map to the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#indexOfValue(kotlin.Any)">value</a></code>.</p> |
| <p>Beware that this is a linear search, unlike lookups by key, and that multiple keys can map to the same value and this will find only one of them.</p> |
| <p>Note also that unlike most collections' <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.ArraySet).indexOf(kotlin.Any,kotlin.Int)">indexOf</a></code> methods, this method compares values using <code>===</code> rather than <code><a href="/reference/androidx/collection/SparseArrayCompat.html#equals(kotlin.Any)">equals</a></code>.</p> |
| </div> |
| <div class="api-item"><a name="isEmpty--"></a><a name="isempty"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="isEmpty()">isEmpty</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public boolean <a href="/reference/androidx/collection/SparseArrayCompat.html#isEmpty()">isEmpty</a>()</pre> |
| <p>Return true if <code><a href="/reference/androidx/collection/SparseArrayCompat.html#size()">size</a></code> is 0.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Returns</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>boolean</code></td> |
| <td> |
| <p>true if <code><a href="/reference/androidx/collection/SparseArrayCompat.html#size()">size</a></code> is 0.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="keyAt-kotlin.Int-"></a><a name="keyat"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="keyAt(kotlin.Int)">keyAt</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public int <a href="/reference/androidx/collection/SparseArrayCompat.html#keyAt(kotlin.Int)">keyAt</a>(int index)</pre> |
| <p>Given an index in the range <code>0...size()-1</code>, returns the key from the <code><a href="/reference/androidx/collection/SparseArrayCompat.html#keyAt(kotlin.Int)">index</a></code>th key-value mapping that this SparseArray stores.</p> |
| </div> |
| <div class="api-item"><a name="put(kotlin.Int, kotlin.Any)"></a><a name="put-kotlin.Int-kotlin.Any-"></a><a name="put"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="put(kotlin.Int,kotlin.Any)">put</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public void <a href="/reference/androidx/collection/SparseArrayCompat.html#put(kotlin.Int,kotlin.Any)">put</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</pre> |
| <p>Adds a mapping from the specified key to the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#put(kotlin.Int,kotlin.Any)">value</a></code>, replacing the previous mapping from the specified <code><a href="/reference/androidx/collection/SparseArrayCompat.html#put(kotlin.Int,kotlin.Any)">key</a></code> if there was one.</p> |
| </div> |
| <div class="api-item"><a name="putAll-androidx.collection.SparseArrayCompat-"></a><a name="putall"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="putAll(androidx.collection.SparseArrayCompat)">putAll</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public void <a href="/reference/androidx/collection/SparseArrayCompat.html#putAll(androidx.collection.SparseArrayCompat)">putAll</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E> other)</pre> |
| <p>Copies all of the mappings from the <code><a href="/reference/androidx/collection/SparseArrayCompat.html#putAll(androidx.collection.SparseArrayCompat)">other</a></code> to this map. The effect of this call is equivalent to that of calling <code><a href="/reference/androidx/collection/SparseArrayCompat.html#put(kotlin.Int,kotlin.Any)">put</a></code> on this map once for each mapping from key to value in <code><a href="/reference/androidx/collection/SparseArrayCompat.html#putAll(androidx.collection.SparseArrayCompat)">other</a></code>.</p> |
| </div> |
| <div class="api-item"><a name="putIfAbsent(kotlin.Int, kotlin.Any)"></a><a name="putIfAbsent-kotlin.Int-kotlin.Any-"></a><a name="putifabsent"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="putIfAbsent(kotlin.Int,kotlin.Any)">putIfAbsent</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public E <a href="/reference/androidx/collection/SparseArrayCompat.html#putIfAbsent(kotlin.Int,kotlin.Any)">putIfAbsent</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</pre> |
| <p>Add a new value to the array map only if the key does not already have a value or it is mapped to <code>null</code>.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>int key</code></td> |
| <td> |
| <p>The key under which to store the value.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value</code></td> |
| <td> |
| <p>The value to store for the given key.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Returns</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>E</code></td> |
| <td> |
| <p>Returns the value that was stored for the given key, or <code>null</code> if there was no such key.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="remove-kotlin.Int-"></a><a name="remove"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="remove(kotlin.Int)">remove</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public void <a href="/reference/androidx/collection/SparseArrayCompat.html#remove(kotlin.Int)">remove</a>(int key)</pre> |
| <p>Removes the mapping from the specified key, if there was any.</p> |
| </div> |
| <div class="api-item"><a name="remove(kotlin.Int, kotlin.Any)"></a><a name="remove-kotlin.Int-kotlin.Any-"></a><a name="remove"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="remove(kotlin.Int,kotlin.Any)">remove</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public boolean <a href="/reference/androidx/collection/SparseArrayCompat.html#remove(kotlin.Int,kotlin.Any)">remove</a>(int key, <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a> value)</pre> |
| <p>Remove an existing key from the array map only if it is currently mapped to <code><a href="/reference/androidx/collection/SparseArrayCompat.html#remove(kotlin.Int,kotlin.Any)">value</a></code>.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>int key</code></td> |
| <td> |
| <p>The key of the mapping to remove.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code><a href="https://developer.android.com/reference/java/lang/Object.html">Object</a> value</code></td> |
| <td> |
| <p>The value expected to be mapped to the key.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Returns</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>boolean</code></td> |
| <td> |
| <p>Returns <code>true</code> if the mapping was removed.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="removeAt-kotlin.Int-"></a><a name="removeat"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="removeAt(kotlin.Int)">removeAt</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public void <a href="/reference/androidx/collection/SparseArrayCompat.html#removeAt(kotlin.Int)">removeAt</a>(int index)</pre> |
| <p>Removes the mapping at the specified index.</p> |
| </div> |
| <div class="api-item"><a name="removeAtRange(kotlin.Int, kotlin.Int)"></a><a name="removeAtRange-kotlin.Int-kotlin.Int-"></a><a name="removeatrange"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="removeAtRange(kotlin.Int,kotlin.Int)">removeAtRange</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public void <a href="/reference/androidx/collection/SparseArrayCompat.html#removeAtRange(kotlin.Int,kotlin.Int)">removeAtRange</a>(int index, int size)</pre> |
| <p>Remove a range of mappings as a batch.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>int index</code></td> |
| <td> |
| <p>Index to begin at</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>int size</code></td> |
| <td> |
| <p>Number of mappings to remove</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="replace(kotlin.Int, kotlin.Any)"></a><a name="replace-kotlin.Int-kotlin.Any-"></a><a name="replace"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="replace(kotlin.Int,kotlin.Any)">replace</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public E <a href="/reference/androidx/collection/SparseArrayCompat.html#replace(kotlin.Int,kotlin.Any)">replace</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</pre> |
| <p>Replace the mapping for <code><a href="/reference/androidx/collection/SparseArrayCompat.html#replace(kotlin.Int,kotlin.Any)">key</a></code> only if it is already mapped to a value.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>int key</code></td> |
| <td> |
| <p>The key of the mapping to replace.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value</code></td> |
| <td> |
| <p>The value to store for the given key.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Returns</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>E</code></td> |
| <td> |
| <p>Returns the previous mapped value or <code>null</code>.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="replace(kotlin.Int, kotlin.Any, kotlin.Any)"></a><a name="replace-kotlin.Int-kotlin.Any-kotlin.Any-"></a><a name="replace"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="replace(kotlin.Int,kotlin.Any,kotlin.Any)">replace</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public boolean <a href="/reference/androidx/collection/SparseArrayCompat.html#replace(kotlin.Int,kotlin.Any,kotlin.Any)">replace</a>(int key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E oldValue, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E newValue)</pre> |
| <p>Replace the mapping for <code><a href="/reference/androidx/collection/SparseArrayCompat.html#replace(kotlin.Int,kotlin.Any,kotlin.Any)">key</a></code> only if it is already mapped to a value.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>int key</code></td> |
| <td> |
| <p>The key of the mapping to replace.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E oldValue</code></td> |
| <td> |
| <p>The value expected to be mapped to the key.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E newValue</code></td> |
| <td> |
| <p>The value to store for the given key.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Returns</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code>boolean</code></td> |
| <td> |
| <p>Returns <code>true</code> if the value was replaced.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="setValueAt(kotlin.Int, kotlin.Any)"></a><a name="setValueAt-kotlin.Int-kotlin.Any-"></a><a name="setvalueat"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="setValueAt(kotlin.Int,kotlin.Any)">setValueAt</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public void <a href="/reference/androidx/collection/SparseArrayCompat.html#setValueAt(kotlin.Int,kotlin.Any)">setValueAt</a>(int index, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E value)</pre> |
| <p>Given an index in the range <code>0...size()-1</code>, sets a new value for the <code><a href="/reference/androidx/collection/SparseArrayCompat.html#setValueAt(kotlin.Int,kotlin.Any)">index</a></code>th key-value mapping that this SparseArray stores.</p> |
| </div> |
| <div class="api-item"><a name="size--"></a><a name="size"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="size()">size</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public int <a href="/reference/androidx/collection/SparseArrayCompat.html#size()">size</a>()</pre> |
| <p>Returns the number of key-value mappings that this SparseArray currently stores.</p> |
| </div> |
| <div class="api-item"><a name="toString--"></a><a name="tostring"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="toString()">toString</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/String.html">String</a> <a href="/reference/androidx/collection/SparseArrayCompat.html#toString()">toString</a>()</pre> |
| <p>Returns a string representation of the object.</p> |
| <p>This implementation composes a string by iterating over its mappings. If this map contains itself as a value, the string "(this Map)" will appear in its place.</p> |
| </div> |
| <div class="api-item"><a name="valueAt-kotlin.Int-"></a><a name="valueat"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="valueAt(kotlin.Int)">valueAt</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> E <a href="/reference/androidx/collection/SparseArrayCompat.html#valueAt(kotlin.Int)">valueAt</a>(int index)</pre> |
| <p>Given an index in the range <code>0...size()-1</code>, returns the value from the <code><a href="/reference/androidx/collection/SparseArrayCompat.html#valueAt(kotlin.Int)">index</a></code>th key-value mapping that this SparseArray stores.</p> |
| </div> |
| </div> |
| <div class="list"> |
| <h2>Extension functions</h2> |
| <div class="api-item"><a name="-androidx.collection.SparseArrayCompat-.contains-kotlin.Int-"></a><a name="contains"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="(androidx.collection.SparseArrayCompat).contains(kotlin.Int)">SparseArrayKt.contains</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final boolean <T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).contains(kotlin.Int)">contains</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> int key<br>)</pre> |
| <p>Returns true if the collection contains <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).contains(kotlin.Int)">key</a></code>.</p> |
| </div> |
| <div class="api-item"><a name="-androidx.collection.SparseArrayCompat-.forEach-kotlin.Function2-"></a><a name="foreach"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="(androidx.collection.SparseArrayCompat).forEach(kotlin.Function2)">SparseArrayKt.forEach</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final void <T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).forEach(kotlin.Function2)">forEach</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2<@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> value, <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>> action<br>)</pre> |
| <p>Performs the given <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).forEach(kotlin.Function2)">action</a></code> for each key/value entry.</p> |
| </div> |
| <div class="api-item"><a name="(androidx.collection.SparseArrayCompat).getOrDefault(kotlin.Int, kotlin.Any)"></a><a name="-androidx.collection.SparseArrayCompat-.getOrDefault-kotlin.Int-kotlin.Any-"></a><a name="getordefault"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="(androidx.collection.SparseArrayCompat).getOrDefault(kotlin.Int,kotlin.Any)">SparseArrayKt.getOrDefault</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T <T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).getOrDefault(kotlin.Int,kotlin.Any)">getOrDefault</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> int key,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T defaultValue<br>)</pre> |
| <p>Return the value corresponding to <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).getOrDefault(kotlin.Int,kotlin.Any)">key</a></code>, or <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).getOrDefault(kotlin.Int,kotlin.Any)">defaultValue</a></code> when not present.</p> |
| </div> |
| <div class="api-item"><a name="(androidx.collection.SparseArrayCompat).getOrElse(kotlin.Int, kotlin.Function0)"></a><a name="-androidx.collection.SparseArrayCompat-.getOrElse-kotlin.Int-kotlin.Function0-"></a><a name="getorelse"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="(androidx.collection.SparseArrayCompat).getOrElse(kotlin.Int,kotlin.Function0)">SparseArrayKt.getOrElse</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T <T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).getOrElse(kotlin.Int,kotlin.Function0)">getOrElse</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> int key,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function0<@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> defaultValue<br>)</pre> |
| <p>Return the value corresponding to <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).getOrElse(kotlin.Int,kotlin.Function0)">key</a></code>, or from <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).getOrElse(kotlin.Int,kotlin.Function0)">defaultValue</a></code> when not present.</p> |
| </div> |
| <div class="api-item"><a name="-androidx.collection.SparseArrayCompat-.getSize--"></a><a name="getsize"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="(androidx.collection.SparseArrayCompat).getSize()">SparseArrayKt.getSize</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final int <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).getSize()">getSize</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver)</pre> |
| <p>Returns the number of key/value pairs in the collection.</p> |
| </div> |
| <div class="api-item"><a name="-androidx.collection.SparseArrayCompat-.isNotEmpty--"></a><a name="isnotempty"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="(androidx.collection.SparseArrayCompat).isNotEmpty()">SparseArrayKt.isNotEmpty</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final boolean <T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).isNotEmpty()">isNotEmpty</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver<br>)</pre> |
| <p>Return true when the collection contains elements.</p> |
| </div> |
| <div class="api-item"><a name="-androidx.collection.SparseArrayCompat-.keyIterator--"></a><a name="keyiterator"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="(androidx.collection.SparseArrayCompat).keyIterator()">SparseArrayKt.keyIterator</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-int-iterator/index.html">IntIterator</a> <T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).keyIterator()">keyIterator</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver<br>)</pre> |
| <p>Return an iterator over the collection's keys.</p> |
| </div> |
| <div class="api-item"><a name="-androidx.collection.SparseArrayCompat-.plus-androidx.collection.SparseArrayCompat-"></a><a name="plus"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="(androidx.collection.SparseArrayCompat).plus(androidx.collection.SparseArrayCompat)">SparseArrayKt.plus</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> <T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).plus(androidx.collection.SparseArrayCompat)">plus</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> other<br>)</pre> |
| <p>Creates a new collection by adding or replacing entries from <code><a href="/reference/androidx/collection/package-summary.html#(androidx.collection.SparseArrayCompat).plus(androidx.collection.SparseArrayCompat)">other</a></code>.</p> |
| </div> |
| <div class="api-item"><a name="(androidx.collection.SparseArrayCompat).set(kotlin.Int, kotlin.Any)"></a><a name="-androidx.collection.SparseArrayCompat-.set-kotlin.Int-kotlin.Any-"></a><a name="set"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="(androidx.collection.SparseArrayCompat).set(kotlin.Int,kotlin.Any)">SparseArrayKt.set</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final void <T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).set(kotlin.Int,kotlin.Any)">set</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver,<br> int key,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T value<br>)</pre> |
| <p>Allows the use of the index operator for storing values in the collection.</p> |
| </div> |
| <div class="api-item"><a name="-androidx.collection.SparseArrayCompat-.valueIterator--"></a><a name="valueiterator"></a> |
| <div class="api-name-block"> |
| <div> |
| <h3 id="(androidx.collection.SparseArrayCompat).valueIterator()">SparseArrayKt.valueIterator</h3> |
| </div> |
| </div> |
| <pre class="api-signature no-pretty-print">public final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/Iterator.html">Iterator</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> <T extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/collection/SparseArrayKt.html">SparseArrayKt</a>.<a href="/reference/androidx/collection/SparseArrayCompat.html#(androidx.collection.SparseArrayCompat).valueIterator()">valueIterator</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/collection/SparseArrayCompat.html">SparseArrayCompat</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T> receiver<br>)</pre> |
| <p>Return an iterator over the collection's values.</p> |
| </div> |
| </div> |
| </body> |
| </html> |