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