Q
- type of first objectpublic class ObjectIntPair<Q> extends Object
and int
Modifier and Type | Field and Description |
---|---|
Q |
first
The first element of the pair
|
int |
second
The first element of the pair
|
static Comparator<ObjectIntPair<?>> |
SECOND_ITEM_ASCENDING_COMPARATOR
Comparator for comparing the second element of a
ObjectIntPair in ascending order. |
static Comparator<ObjectIntPair<?>> |
SECOND_ITEM_DESCENDING_COMPARATOR
Comparator for comparing the second element of a
ObjectIntPair in descending order. |
Constructor and Description |
---|
ObjectIntPair()
Construct empty pair
|
ObjectIntPair(Q f,
int s)
Construct pair with given values
|
Modifier and Type | Method and Description |
---|---|
Q |
getFirst()
Get the value of the first element
|
static <Q> List<Q> |
getFirst(Iterable<ObjectIntPair<Q>> data)
Extract the first objects from a list of pairs.
|
int |
getSecond()
Get the value of the second element
|
static <Q> gnu.trove.list.array.TIntArrayList |
getSecond(Iterable<ObjectIntPair<Q>> data)
Extract the second objects from a list of pairs.
|
static <Q> ObjectIntPair<Q> |
pair(Q q,
int t)
Create a pair from the given objects.
|
void |
setFirst(Q first)
Set the value of the first element
|
void |
setSecond(int second)
Set the value of the second element
|
public static final Comparator<ObjectIntPair<?>> SECOND_ITEM_ASCENDING_COMPARATOR
ObjectIntPair
in ascending order.public static final Comparator<ObjectIntPair<?>> SECOND_ITEM_DESCENDING_COMPARATOR
ObjectIntPair
in descending order.public int second
public ObjectIntPair(Q f, int s)
f
- first values
- second valuepublic ObjectIntPair()
public void setFirst(Q first)
first
- the value to setpublic int getSecond()
public void setSecond(int second)
second
- the value to setpublic static <Q> ObjectIntPair<Q> pair(Q q, int t)
Q
- Type of first object.q
- The first object.t
- The second object.public static <Q> gnu.trove.list.array.TIntArrayList getSecond(Iterable<ObjectIntPair<Q>> data)
Q
- type of first objectdata
- the datapublic static <Q> List<Q> getFirst(Iterable<ObjectIntPair<Q>> data)
Q
- type of first objectdata
- the data