blob: 63a2ab5f7103205287dc3bb8d7cdcc6f82be08dd [file] [log] [blame]
<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&nbsp;final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;</code></td>
<td>
<div><code>&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/runtime/collection/MutableVectorKt.html#MutableVector(kotlin.Int)">MutableVector</a>(int&nbsp;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&nbsp;final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;</code></td>
<td>
<div><code>&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/runtime/collection/MutableVectorKt.html#MutableVector(kotlin.Int,kotlin.Function1)">MutableVector</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;size,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;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&nbsp;final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;</code></td>
<td>
<div><code>&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <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&nbsp;final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;</code></td>
<td>
<div><code>&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/runtime/collection/MutableVectorKt.html#mutableVectorOf(kotlin.Array)">mutableVectorOf</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&nbsp;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&nbsp;static&nbsp;final&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/runtime/collection/MutableVectorKt.html#MutableVector(kotlin.Int)">MutableVector</a>(int&nbsp;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&nbsp;static&nbsp;final&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/runtime/collection/MutableVectorKt.html#MutableVector(kotlin.Int,kotlin.Function1)">MutableVector</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;size,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;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&nbsp;static&nbsp;final&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <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&nbsp;static&nbsp;final&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/collection/MutableVector.html">MutableVector</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/runtime/collection/MutableVectorKt.html#mutableVectorOf(kotlin.Array)">mutableVectorOf</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&nbsp;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>