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