public class IntLongPair extends Object
Modifier and Type | Field and Description |
---|---|
int |
first
The first element of the pair
|
static Comparator<IntLongPair> |
FIRST_ITEM_ASCENDING_COMPARATOR
Comparator for comparing the first element of a
IntLongPair in ascending order. |
static Comparator<IntLongPair> |
FIRST_ITEM_DESCENDING_COMPARATOR
Comparator for comparing the first element of a
IntLongPair in descending order. |
long |
second
The first element of the pair
|
static Comparator<IntLongPair> |
SECOND_ITEM_ASCENDING_COMPARATOR
Comparator for comparing the second element of a
IntLongPair in ascending order. |
static Comparator<IntLongPair> |
SECOND_ITEM_DESCENDING_COMPARATOR
Comparator for comparing the second element of a
IntLongPair in descending order. |
Constructor and Description |
---|
IntLongPair()
Construct empty pair
|
IntLongPair(int f,
long s)
Construct pair with given values
|
Modifier and Type | Method and Description |
---|---|
int |
getFirst()
Get the value of the first element
|
static gnu.trove.list.array.TIntArrayList |
getFirst(Iterable<IntLongPair> data)
Extract the first values from a list of pairs.
|
long |
getSecond()
Get the value of the second element
|
static gnu.trove.list.array.TLongArrayList |
getSecond(Iterable<IntLongPair> data)
Extract the second values from a list of pairs.
|
static IntLongPair |
pair(int a,
long b)
Create a pair from the given values.
|
void |
setFirst(int first)
Set the value of the first element
|
void |
setSecond(long second)
Set the value of the second element
|
String |
toString() |
public static final Comparator<IntLongPair> FIRST_ITEM_ASCENDING_COMPARATOR
IntLongPair
in ascending order.public static final Comparator<IntLongPair> FIRST_ITEM_DESCENDING_COMPARATOR
IntLongPair
in descending order.public static final Comparator<IntLongPair> SECOND_ITEM_ASCENDING_COMPARATOR
IntLongPair
in ascending order.public static final Comparator<IntLongPair> SECOND_ITEM_DESCENDING_COMPARATOR
IntLongPair
in descending order.public int first
public long second
public IntLongPair(int f, long s)
f
- first values
- second valuepublic IntLongPair()
public int getFirst()
public void setFirst(int first)
first
- the value to setpublic long getSecond()
public void setSecond(long second)
second
- the value to setpublic static IntLongPair pair(int a, long b)
a
- The first object.b
- The second object.public static gnu.trove.list.array.TLongArrayList getSecond(Iterable<IntLongPair> data)
data
- the datapublic static gnu.trove.list.array.TIntArrayList getFirst(Iterable<IntLongPair> data)
data
- the data