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