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