# LongListKt

Added in 1.4.0

*** ** * ** ***


```
public final class LongListKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#buildLongList(kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builderAction )` Builds a new `https://developer.android.com/reference/androidx/collection/LongList` by populating a `https://developer.android.com/reference/androidx/collection/MutableLongList` using the given `https://developer.android.com/reference/androidx/collection/package-summary#buildLongList(kotlin.Function1)`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#buildLongList(kotlin.Int,kotlin.Function1)( int initialCapacity, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builderAction )` Builds a new `https://developer.android.com/reference/androidx/collection/LongList` by populating a `https://developer.android.com/reference/androidx/collection/MutableLongList` using the given `https://developer.android.com/reference/androidx/collection/package-summary#buildLongList(kotlin.Int,kotlin.Function1)`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#emptyLongList()()` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#longListOf()()` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#longListOf(kotlin.Long)(long element1)` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#longListOf(kotlin.LongArray)(long... elements)` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#longListOf(kotlin.Long,kotlin.Long)(long element1, long element2)` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#longListOf(kotlin.Long,kotlin.Long,kotlin.Long)(long element1, long element2, long element3)` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#mutableLongListOf()()` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#mutableLongListOf(kotlin.Long)(long element1)` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#mutableLongListOf(kotlin.LongArray)(long... elements)` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#mutableLongListOf(kotlin.Long,kotlin.Long)(long element1, long element2)` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList` | `https://developer.android.com/reference/androidx/collection/LongListKt#mutableLongListOf(kotlin.Long,kotlin.Long,kotlin.Long)(long element1, long element2, long element3)` |

## Public methods

### buildLongList

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:buildLongList) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/collection#1.5.0)

```
public static final @NonNull LongList buildLongList(
    @NonNull Function1<@NonNull MutableLongList, Unit> builderAction
)
```

Builds a new `https://developer.android.com/reference/androidx/collection/LongList` by populating a `https://developer.android.com/reference/androidx/collection/MutableLongList` using the given `https://developer.android.com/reference/androidx/collection/package-summary#buildLongList(kotlin.Function1)`.

The instance passed as a receiver to the `https://developer.android.com/reference/androidx/collection/package-summary#buildLongList(kotlin.Function1)` is valid only inside that function. Using it outside of the function produces an unspecified behavior.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builderAction` | Lambda in which the `https://developer.android.com/reference/androidx/collection/MutableLongList` can be populated. |

### buildLongList

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:buildLongList) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/collection#1.5.0)

```
public static final @NonNull LongList buildLongList(
    int initialCapacity,
    @NonNull Function1<@NonNull MutableLongList, Unit> builderAction
)
```

Builds a new `https://developer.android.com/reference/androidx/collection/LongList` by populating a `https://developer.android.com/reference/androidx/collection/MutableLongList` using the given `https://developer.android.com/reference/androidx/collection/package-summary#buildLongList(kotlin.Int,kotlin.Function1)`.

The instance passed as a receiver to the `https://developer.android.com/reference/androidx/collection/package-summary#buildLongList(kotlin.Int,kotlin.Function1)` is valid only inside that function. Using it outside of the function produces an unspecified behavior.

| Parameters |
|---|---|
| `int initialCapacity` | Hint for the expected number of elements added in the `https://developer.android.com/reference/androidx/collection/package-summary#buildLongList(kotlin.Int,kotlin.Function1)`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builderAction` | Lambda in which the `https://developer.android.com/reference/androidx/collection/MutableLongList` can be populated. |

### emptyLongList

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:emptyLongList) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
public static final @NonNull LongList emptyLongList()
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | a read-only `https://developer.android.com/reference/androidx/collection/LongList` with nothing in it. |

### longListOf

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:longListOf) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
public static final @NonNull LongList longListOf()
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | a read-only `https://developer.android.com/reference/androidx/collection/LongList` with nothing in it. |

### longListOf

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:longListOf) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
public static final @NonNull LongList longListOf(long element1)
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | a new read-only `https://developer.android.com/reference/androidx/collection/LongList` with `https://developer.android.com/reference/androidx/collection/package-summary#longListOf(kotlin.Long)` as the only item in the list. |

### longListOf

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:longListOf) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
public static final @NonNull LongList longListOf(long... elements)
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | a new read-only `https://developer.android.com/reference/androidx/collection/LongList` with `https://developer.android.com/reference/androidx/collection/package-summary#longListOf(kotlin.LongArray)` in order. |

### longListOf

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:longListOf) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
public static final @NonNull LongList longListOf(long element1, long element2)
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | a new read-only `https://developer.android.com/reference/androidx/collection/LongList` with 2 elements, `https://developer.android.com/reference/androidx/collection/package-summary#longListOf(kotlin.Long,kotlin.Long)` and `https://developer.android.com/reference/androidx/collection/package-summary#longListOf(kotlin.Long,kotlin.Long)`, in order. |

### longListOf

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:longListOf) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
public static final @NonNull LongList longListOf(long element1, long element2, long element3)
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/LongList` | a new read-only `https://developer.android.com/reference/androidx/collection/LongList` with 3 elements, `https://developer.android.com/reference/androidx/collection/package-summary#longListOf(kotlin.Long,kotlin.Long,kotlin.Long)`, `https://developer.android.com/reference/androidx/collection/package-summary#longListOf(kotlin.Long,kotlin.Long,kotlin.Long)`, and `https://developer.android.com/reference/androidx/collection/package-summary#longListOf(kotlin.Long,kotlin.Long,kotlin.Long)`, in order. |

### mutableLongListOf

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:mutableLongListOf) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
public static final @NonNull MutableLongList mutableLongListOf()
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList` | a new empty `https://developer.android.com/reference/androidx/collection/MutableLongList` with the default capacity. |

### mutableLongListOf

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:mutableLongListOf) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
public static final @NonNull MutableLongList mutableLongListOf(long element1)
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList` | a new `https://developer.android.com/reference/androidx/collection/MutableLongList` with `https://developer.android.com/reference/androidx/collection/package-summary#mutableLongListOf(kotlin.Long)` as the only item in the list. |

### mutableLongListOf

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:mutableLongListOf) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
public static final @NonNull MutableLongList mutableLongListOf(long... elements)
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList` | a new `https://developer.android.com/reference/androidx/collection/MutableLongList` with the given elements, in order. |

### mutableLongListOf

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:mutableLongListOf) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
public static final @NonNull MutableLongList mutableLongListOf(long element1, long element2)
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList` | a new `https://developer.android.com/reference/androidx/collection/MutableLongList` with 2 elements, `https://developer.android.com/reference/androidx/collection/package-summary#mutableLongListOf(kotlin.Long,kotlin.Long)` and `https://developer.android.com/reference/androidx/collection/package-summary#mutableLongListOf(kotlin.Long,kotlin.Long)`, in order. |

### mutableLongListOf

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection) [View Source](https://cs.android.com/search?q=file:androidx/collection/LongList.kt+function:mutableLongListOf) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
public static final @NonNull MutableLongList mutableLongListOf(long element1, long element2, long element3)
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableLongList` | a new `https://developer.android.com/reference/androidx/collection/MutableLongList` with 3 elements, `https://developer.android.com/reference/androidx/collection/package-summary#mutableLongListOf(kotlin.Long,kotlin.Long,kotlin.Long)`, `https://developer.android.com/reference/androidx/collection/package-summary#mutableLongListOf(kotlin.Long,kotlin.Long,kotlin.Long)`, and `https://developer.android.com/reference/androidx/collection/package-summary#mutableLongListOf(kotlin.Long,kotlin.Long,kotlin.Long)`, in order. |