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