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