IntIntPair
-
Cmn
value class IntIntPair
Container to ease passing around a tuple of two Int 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 Int parameters directly (see LongLongPair for an example).
Summary
Public constructors |
|
|---|---|
IntIntPair(first: Int, second: Int)Constructs a |
Cmn
|
Public functions |
||
|---|---|---|
inline operator Int |
Returns the |
Cmn
|
inline operator Int |
Returns the |
Cmn
|
open String |
toString() |
Cmn
|
Public properties |
||
|---|---|---|
Int |
The first value in the pair. |
Cmn
|
Long |
The internal representation of the |
Cmn
|
Int |
The second value in the pair. |
Cmn
|
Public constructors
Public functions
component1
inline operator fun component1(): Int
Returns the 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:
val (first, second) = myPair
component2
inline operator fun component2(): Int
Returns the 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:
val (first, second) = myPair
Public properties
packedValue
val packedValue: Long
The internal representation of the IntIntPair. packedValue has no guarantees for stability across library versions.