# FloatFloatPair

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

*** ** * ** ***

<br />

```
value public final class FloatFloatPair
```

<br />

*** ** * ** ***

Container to ease passing around a tuple of two `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/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 Float parameters directly (see `https://developer.android.com/reference/androidx/collection/LongLongPair` for an example).

## Summary

| ### Public fields |
|---|---|
| `final long` | `https://developer.android.com/reference/androidx/collection/FloatFloatPair#packedValue()` The internal representation of the `https://developer.android.com/reference/androidx/collection/FloatFloatPair`. |

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

| ### Public methods |
|---|---|
| `final float` | `https://developer.android.com/reference/androidx/collection/FloatFloatPair#component1()()` Returns the `https://developer.android.com/reference/androidx/collection/FloatFloatPair#first()` component of the pair. |
| `final float` | `https://developer.android.com/reference/androidx/collection/FloatFloatPair#component2()()` Returns the `https://developer.android.com/reference/androidx/collection/FloatFloatPair#second()` component of the pair. |
| `final float` | `https://developer.android.com/reference/androidx/collection/FloatFloatPair#getFirst()()` The first value in the pair. |
| `final float` | `https://developer.android.com/reference/androidx/collection/FloatFloatPair#getSecond()()` The second value in the pair. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/collection/FloatFloatPair#toString()()` |

## Public fields

### packedValue

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

```
public final long packedValue
```

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

## Public constructors

### FloatFloatPair

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

```
public FloatFloatPair(float first, float second)
```

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

| Parameters |
|---|---|
| `float first` | the first value in the pair |
| `float 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 float component1()
```

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

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 float component2()
```

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

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

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

### getFirst

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

```
public final float 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 float getSecond()
```

The second value in the pair.

### toString

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