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