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