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