Package Utils
Class SortByIndexDouble
- java.lang.Object
-
- Utils.SortByIndexDouble
-
- All Implemented Interfaces:
java.util.Comparator<java.lang.Integer>
public class SortByIndexDouble extends java.lang.Object implements java.util.Comparator<java.lang.Integer>
Comparator to sort integer indicies based on the corresponding value in a double array.
-
-
Constructor Summary
Constructors Constructor Description SortByIndexDouble(double[] values)
Constructor.SortByIndexDouble(double[] values, boolean reverse)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(java.lang.Integer i, java.lang.Integer j)
java.lang.Integer[]
sort()
Produce a sorted list of indicies for the entire array
-
-
-
Constructor Detail
-
SortByIndexDouble
public SortByIndexDouble(double[] values)
Constructor. Defaults to sorting in standard order.- Parameters:
values
- The double array used to sort the indicies
-
SortByIndexDouble
public SortByIndexDouble(double[] values, boolean reverse)
Constructor. Can sort in either standard or reverse order.- Parameters:
values
- The double array used to sort the indiciesreverse
- If true sorts in reverse order
-
-