# LongLongPair

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

*** ** * ** ***

<br />

```
public final class LongLongPair
```

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/collection/LongLongPair#LongLongPair(kotlin.Long,kotlin.Long)(long first, long second)` |

| ### Public methods |
|---|---|
| `final long` | `https://developer.android.com/reference/androidx/collection/LongLongPair#component1()()` Returns the `https://developer.android.com/reference/androidx/collection/LongLongPair#first()` component of the pair. |
| `final long` | `https://developer.android.com/reference/androidx/collection/LongLongPair#component2()()` Returns the `https://developer.android.com/reference/androidx/collection/LongLongPair#second()` component of the pair. |
| `boolean` | `https://developer.android.com/reference/androidx/collection/LongLongPair#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` Checks the two values for equality. |
| `final long` | `https://developer.android.com/reference/androidx/collection/LongLongPair#getFirst()()` the first value in the pair |
| `final long` | `https://developer.android.com/reference/androidx/collection/LongLongPair#getSecond()()` the second value in the pair |
| `int` | `https://developer.android.com/reference/androidx/collection/LongLongPair#hashCode()()` Compute a hash code using the hash codes of the underlying values |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/collection/LongLongPair#toString()()` |

## Public constructors

### LongLongPair

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

```
public LongLongPair(long first, long second)
```

| Parameters |
|---|---|
| `long first` | the first value in the pair |
| `long second` | the second value in the pair |

## Public methods

### component1

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

```
public final long component1()
```

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

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

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

### component2

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

```
public final long component2()
```

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

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

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

### equals

```
public boolean equals(Object other)
```

Checks the two values for equality.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html other` | the `https://developer.android.com/reference/androidx/collection/LongLongPair` to which this one is to be checked for equality |

| Returns |
|---|---|
| `boolean` | true if the underlying values of the `https://developer.android.com/reference/androidx/collection/LongLongPair` are both considered equal |

### getFirst

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

```
public final long getFirst()
```

the first value in the pair

### getSecond

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

```
public final long getSecond()
```

the second value in the pair

### hashCode

```
public int hashCode()
```

Compute a hash code using the hash codes of the underlying values

| Returns |
|---|---|
| `int` | a hashcode of the `https://developer.android.com/reference/androidx/collection/LongLongPair` |

### toString

```
public @NonNull String toString()
```