| <html devsite="true"> |
| <head> |
| <title>MutableVectorKt</title> |
| {% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} |
| {% include "_shared/_reference-head-tags.html" %} |
| </head> |
| <body> |
| <h1>MutableVectorKt</h1> |
| <p> |
| <pre>public final class <a href="/reference/androidx/compose/runtime/collection/MutableVectorKt.html">MutableVectorKt</a></pre> |
| </p> |
| <hr> |
| <h2>Summary</h2> |
| <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>static final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</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/compose/runtime/collection/MutableVectorKt.html#MutableVector(kotlin.Int)">MutableVector</a>(int capacity)</code></div> |
| <p>Create a <code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a></code> with a given initial <code><a href="/reference/androidx/compose/runtime/collection/package-summary.html#MutableVector(kotlin.Int)">capacity</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>static final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</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/compose/runtime/collection/MutableVectorKt.html#MutableVector(kotlin.Int,kotlin.Function1)">MutableVector</a>(<br> int size,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1<@<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> T> init<br>)</code></div> |
| <p>Create a <code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a></code> with a given <code><a href="/reference/androidx/compose/runtime/collection/package-summary.html#MutableVector(kotlin.Int,kotlin.Function1)">size</a></code>, initializing each element using the <code><a href="/reference/androidx/compose/runtime/collection/package-summary.html#MutableVector(kotlin.Int,kotlin.Function1)">init</a></code> function.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>static final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</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/compose/runtime/collection/MutableVectorKt.html#mutableVectorOf()">mutableVectorOf</a>()</code></div> |
| <p>Creates an empty <code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a></code> with a <code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html#ensureCapacity(kotlin.Int)">capacity</a></code> of 16.</p> |
| </td> |
| </tr> |
| <tr> |
| <td><code>static final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</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/compose/runtime/collection/MutableVectorKt.html#mutableVectorOf(kotlin.Array)">mutableVectorOf</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T elements)</code></div> |
| <p>Creates a <code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a></code> with the given values.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="list"> |
| <h2>Public methods</h2> |
| <div class="api-item"><a name="MutableVector-kotlin.Int-"></a><a name="mutablevector"></a> |
| <h3 class="api-name" id="MutableVector(kotlin.Int)">MutableVector</h3> |
| <pre class="api-signature no-pretty-print">public static final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</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/compose/runtime/collection/MutableVectorKt.html#MutableVector(kotlin.Int)">MutableVector</a>(int capacity)</pre> |
| <p>Create a <code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a></code> with a given initial <code><a href="/reference/androidx/compose/runtime/collection/package-summary.html#MutableVector(kotlin.Int)">capacity</a></code>.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">See also</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html#ensureCapacity(kotlin.Int)">ensureCapacity</a></code></td> |
| <td></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="MutableVector(kotlin.Int, kotlin.Function1)"></a><a name="MutableVector-kotlin.Int-kotlin.Function1-"></a><a name="mutablevector"></a> |
| <h3 class="api-name" id="MutableVector(kotlin.Int,kotlin.Function1)">MutableVector</h3> |
| <pre class="api-signature no-pretty-print">public static final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</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/compose/runtime/collection/MutableVectorKt.html#MutableVector(kotlin.Int,kotlin.Function1)">MutableVector</a>(<br> int size,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1<@<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> T> init<br>)</pre> |
| <p>Create a <code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a></code> with a given <code><a href="/reference/androidx/compose/runtime/collection/package-summary.html#MutableVector(kotlin.Int,kotlin.Function1)">size</a></code>, initializing each element using the <code><a href="/reference/androidx/compose/runtime/collection/package-summary.html#MutableVector(kotlin.Int,kotlin.Function1)">init</a></code> function.</p> |
| <p><code><a href="/reference/androidx/compose/runtime/collection/package-summary.html#MutableVector(kotlin.Int,kotlin.Function1)">init</a></code> is called for each element in the <code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a></code>, starting from the first one and should return the value to be assigned to the element at its given index.</p> |
| </div> |
| <div class="api-item"><a name="mutableVectorOf--"></a><a name="mutablevectorof"></a> |
| <h3 class="api-name" id="mutableVectorOf()">mutableVectorOf</h3> |
| <pre class="api-signature no-pretty-print">public static final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</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/compose/runtime/collection/MutableVectorKt.html#mutableVectorOf()">mutableVectorOf</a>()</pre> |
| <p>Creates an empty <code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a></code> with a <code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html#ensureCapacity(kotlin.Int)">capacity</a></code> of 16.</p> |
| </div> |
| <div class="api-item"><a name="mutableVectorOf-kotlin.Array-"></a><a name="mutablevectorof"></a> |
| <h3 class="api-name" id="mutableVectorOf(kotlin.Array)">mutableVectorOf</h3> |
| <pre class="api-signature no-pretty-print">public static final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</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/compose/runtime/collection/MutableVectorKt.html#mutableVectorOf(kotlin.Array)">mutableVectorOf</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T elements)</pre> |
| <p>Creates a <code><a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a></code> with the given values. This will use the passed vararg <code><a href="/reference/androidx/compose/runtime/collection/package-summary.html#mutableVectorOf(kotlin.Array)">elements</a></code> storage.</p> |
| </div> |
| </div> |
| </body> |
| </html> |