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