# IntSetKt

Added in 1.4.0

*** ** * ** ***


```
public final class IntSetKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/IntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#buildIntSet(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/MutableIntSet, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builderAction )` Builds a new `https://developer.android.com/reference/androidx/collection/IntSet` by populating a `https://developer.android.com/reference/androidx/collection/MutableIntSet` using the given `https://developer.android.com/reference/androidx/collection/package-summary#buildIntSet(kotlin.Function1)`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/IntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#buildIntSet(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/MutableIntSet, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builderAction )` Builds a new `https://developer.android.com/reference/androidx/collection/IntSet` by populating a `https://developer.android.com/reference/androidx/collection/MutableIntSet` using the given `https://developer.android.com/reference/androidx/collection/package-summary#buildIntSet(kotlin.Int,kotlin.Function1)`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/IntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#emptyIntSet()()` Returns an empty, read-only `https://developer.android.com/reference/androidx/collection/IntSet`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/IntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#intSetOf()()` Returns an empty, read-only `https://developer.android.com/reference/androidx/collection/ScatterSet`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/IntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#intSetOf(kotlin.Int)(int element1)` Returns a new read-only `https://developer.android.com/reference/androidx/collection/IntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int)` in it. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/IntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#intSetOf(kotlin.IntArray)(int... elements)` Returns a new read-only `https://developer.android.com/reference/androidx/collection/IntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.IntArray)` in it. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/IntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#intSetOf(kotlin.Int,kotlin.Int)(int element1, int element2)` Returns a new read-only `https://developer.android.com/reference/androidx/collection/IntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int,kotlin.Int)` and `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int,kotlin.Int)` in it. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/IntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#intSetOf(kotlin.Int,kotlin.Int,kotlin.Int)(int element1, int element2, int element3)` Returns a new read-only `https://developer.android.com/reference/androidx/collection/IntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int,kotlin.Int,kotlin.Int)`, `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int,kotlin.Int,kotlin.Int)`, and `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int,kotlin.Int,kotlin.Int)` in it. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableIntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#mutableIntSetOf()()` Returns a new `https://developer.android.com/reference/androidx/collection/MutableIntSet`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableIntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#mutableIntSetOf(kotlin.Int)(int element1)` Returns a new `https://developer.android.com/reference/androidx/collection/MutableIntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int)` in it. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableIntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#mutableIntSetOf(kotlin.IntArray)(int... elements)` Returns a new `https://developer.android.com/reference/androidx/collection/MutableIntSet` with the specified elements. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableIntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#mutableIntSetOf(kotlin.Int,kotlin.Int)(int element1, int element2)` Returns a new `https://developer.android.com/reference/androidx/collection/MutableIntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int,kotlin.Int)` and `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int,kotlin.Int)` in it. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/collection/MutableIntSet` | `https://developer.android.com/reference/androidx/collection/IntSetKt#mutableIntSetOf(kotlin.Int,kotlin.Int,kotlin.Int)(int element1, int element2, int element3)` Returns a new `https://developer.android.com/reference/androidx/collection/MutableIntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int,kotlin.Int,kotlin.Int)`, `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int,kotlin.Int,kotlin.Int)`, and `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int,kotlin.Int,kotlin.Int)` in it. |

## Public methods

### buildIntSet

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

```
public static final @NonNull IntSet buildIntSet(
    @NonNull Function1<@NonNull MutableIntSet, Unit> builderAction
)
```

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

The set passed as a receiver to the `https://developer.android.com/reference/androidx/collection/package-summary#buildIntSet(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/MutableIntSet, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builderAction` | Lambda in which the `https://developer.android.com/reference/androidx/collection/MutableIntSet` can be populated. |

### buildIntSet

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

```
public static final @NonNull IntSet buildIntSet(
    int initialCapacity,
    @NonNull Function1<@NonNull MutableIntSet, Unit> builderAction
)
```

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

The set passed as a receiver to the `https://developer.android.com/reference/androidx/collection/package-summary#buildIntSet(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#buildIntSet(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/MutableIntSet, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builderAction` | Lambda in which the `https://developer.android.com/reference/androidx/collection/MutableIntSet` can be populated. |

### emptyIntSet

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

```
public static final @NonNull IntSet emptyIntSet()
```

Returns an empty, read-only `https://developer.android.com/reference/androidx/collection/IntSet`.

### intSetOf

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

```
public static final @NonNull IntSet intSetOf()
```

Returns an empty, read-only `https://developer.android.com/reference/androidx/collection/ScatterSet`.

### intSetOf

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

```
public static final @NonNull IntSet intSetOf(int element1)
```

Returns a new read-only `https://developer.android.com/reference/androidx/collection/IntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int)` in it.

### intSetOf

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

```
public static final @NonNull IntSet intSetOf(int... elements)
```

Returns a new read-only `https://developer.android.com/reference/androidx/collection/IntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.IntArray)` in it.

### intSetOf

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

```
public static final @NonNull IntSet intSetOf(int element1, int element2)
```

Returns a new read-only `https://developer.android.com/reference/androidx/collection/IntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int,kotlin.Int)` and `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int,kotlin.Int)` in it.

### intSetOf

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

```
public static final @NonNull IntSet intSetOf(int element1, int element2, int element3)
```

Returns a new read-only `https://developer.android.com/reference/androidx/collection/IntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int,kotlin.Int,kotlin.Int)`, `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int,kotlin.Int,kotlin.Int)`, and `https://developer.android.com/reference/androidx/collection/package-summary#intSetOf(kotlin.Int,kotlin.Int,kotlin.Int)` in it.

### mutableIntSetOf

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

```
public static final @NonNull MutableIntSet mutableIntSetOf()
```

Returns a new `https://developer.android.com/reference/androidx/collection/MutableIntSet`.

### mutableIntSetOf

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

```
public static final @NonNull MutableIntSet mutableIntSetOf(int element1)
```

Returns a new `https://developer.android.com/reference/androidx/collection/MutableIntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int)` in it.

### mutableIntSetOf

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

```
public static final @NonNull MutableIntSet mutableIntSetOf(int... elements)
```

Returns a new `https://developer.android.com/reference/androidx/collection/MutableIntSet` with the specified elements.

### mutableIntSetOf

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

```
public static final @NonNull MutableIntSet mutableIntSetOf(int element1, int element2)
```

Returns a new `https://developer.android.com/reference/androidx/collection/MutableIntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int,kotlin.Int)` and `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int,kotlin.Int)` in it.

### mutableIntSetOf

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

```
public static final @NonNull MutableIntSet mutableIntSetOf(int element1, int element2, int element3)
```

Returns a new `https://developer.android.com/reference/androidx/collection/MutableIntSet` with only `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int,kotlin.Int,kotlin.Int)`, `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int,kotlin.Int,kotlin.Int)`, and `https://developer.android.com/reference/androidx/collection/package-summary#mutableIntSetOf(kotlin.Int,kotlin.Int,kotlin.Int)` in it.