java.util.Comparator<java.lang.Integer>
public class SortByIndexDouble
extends java.lang.Object
implements java.util.Comparator<java.lang.Integer>
Constructor | Description |
---|---|
SortByIndexDouble(double[] values) |
Constructor.
|
SortByIndexDouble(double[] values,
boolean reverse) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
int |
compare(java.lang.Integer i,
java.lang.Integer j) |
Overrides the default compare method and instead compares the ith and jth
element of the values array
|
java.lang.Integer[] |
sort() |
Produce a sorted list of indices for the entire array
|
public SortByIndexDouble(double[] values)
values
- The double array used to sort the indicespublic SortByIndexDouble(double[] values, boolean reverse)
values
- The double array used to sort the indicesreverse
- If true sorts in reverse orderpublic int compare(java.lang.Integer i, java.lang.Integer j)
compare
in interface java.util.Comparator<java.lang.Integer>
i
- The index of the first element to comparej
- The index of the second element to comparepublic java.lang.Integer[] sort()