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