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