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