public class ArrayIndexComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.Integer>
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Double[] |
array
Array with the values for which we would like to get the ordered indices
|
| Constructor and Description |
|---|
ArrayIndexComparator(double[] vals)
Load this class with the double array for which we'd like to do comparison
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(java.lang.Integer index1,
java.lang.Integer index2)
Value-based index comparision: An index value is "larger" than another index value if
it points to a larger array element
|
java.lang.Integer[] |
createIndexArray()
Convenience function.
|
protected java.lang.Double[] array
public ArrayIndexComparator(double[] vals)
vals - The values for wich we would like to get the indices indicating their orgeringpublic java.lang.Integer[] createIndexArray()
public int compare(java.lang.Integer index1,
java.lang.Integer index2)
compare in interface java.util.Comparator<java.lang.Integer>