# IntIntPair

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

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  value class IntIntPair
  ```

*** ** * ** ***

Container to ease passing around a tuple of two `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` values.

*Note* : This class is optimized by using a value class, a Kotlin language featured not available from Java code. Java developers can get the same functionality by using `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html` or by constructing a custom implementation using Int parameters directly (see `https://developer.android.com/reference/kotlin/androidx/collection/LongLongPair` for an example).

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#IntIntPair(kotlin.Int,kotlin.Int)(first: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, second: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Constructs a `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair` with two `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` values. | Cmn |

| ### Public functions |
|---|---|---|
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#component1()()` Returns the `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#first()` component of the pair. | Cmn |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#component2()()` Returns the `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#second()` component of the pair. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#first()` The first value in the pair. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#packedValue()` The internal representation of the `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#second()` The second value in the pair. | Cmn |

## Public constructors

### IntIntPair

Cmn Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
IntIntPair(first: Int, second: Int)
```

Constructs a `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair` with two `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` values.

| Parameters |
|---|---|
| `first: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the first value in the pair |
| `second: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the second value in the pair |

## Public functions

### component1

Cmn Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
inline operator fun component1(): Int
```

Returns the `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#first()` component of the pair. For instance, the first component of `PairIntInt(3, 4)` is `3`.

This method allows to use destructuring declarations when working with pairs, for example:

```kotlin
val (first, second) = myPair
```

### component2

Cmn Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
inline operator fun component2(): Int
```

Returns the `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#second()` component of the pair. For instance, the second component of `PairIntInt(3, 4)` is `4`.

This method allows to use destructuring declarations when working with pairs, for example:

```kotlin
val (first, second) = myPair
```

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### first

Cmn Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
val first: Int
```

The first value in the pair.

### packedValue

Cmn Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/collection#1.5.0)

```
val packedValue: Long
```

The internal representation of the `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair`. `https://developer.android.com/reference/kotlin/androidx/collection/IntIntPair#(kotlin.Long)` has no guarantees for stability across library versions.

### second

Cmn Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

```
val second: Int
```

The second value in the pair.