FloatFloatPair
value public final class FloatFloatPair
Container to ease passing around a tuple of two Float 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 Pair or by constructing a custom implementation using Float parameters directly (see LongLongPair for an example).
Summary
Public fields |
|
|---|---|
final long |
The internal representation of the |
Public constructors |
|---|
FloatFloatPair(float first, float second)Constructs a |
Public methods |
|
|---|---|
final float |
Returns the |
final float |
Returns the |
final float |
getFirst()The first value in the pair. |
final float |
The second value in the pair. |
@NonNull String |
toString() |
Public fields
packedValue
public final long packedValue
The internal representation of the FloatFloatPair. packedValue has no guarantees for stability across library versions.
Public constructors
FloatFloatPair
public FloatFloatPair(float first, float second)
Constructs a FloatFloatPair with two Float values.
| Parameters | |
|---|---|
float first |
the first value in the pair |
float second |
the second value in the pair |
Public methods
component1
public final float component1()
Returns the 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
public final float component2()
Returns the 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