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