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