LongLongPair


public final class LongLongPair


Container to ease passing around a tuple of two Long values.

Summary

Public constructors

LongLongPair(long first, long second)

Public methods

final long

Returns the first component of the pair.

final long

Returns the second component of the pair.

boolean
equals(Object other)

Checks the two values for equality.

final long

the first value in the pair

final long

the second value in the pair

int

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

@NonNull String

Public constructors

LongLongPair

Added in 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
public final long component1()

Returns the 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
public final long component2()

Returns the 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
Object other

the LongLongPair to which this one is to be checked for equality

Returns
boolean

true if the underlying values of the LongLongPair are both considered equal

getFirst

Added in 1.4.0
public final long getFirst()

the first value in the pair

getSecond

Added in 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 LongLongPair

toString

public @NonNull String toString()