public class DoubleArrayComparator extends Object implements Comparator<double[]>
Comparator
of double arrays.
It just uses the double value at a specific index of the array to compare two arrays.
This index can be set in the constructor.Constructor and Description |
---|
DoubleArrayComparator(int idx)
Creates a new instance with a specific index for comparing double arrays.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(double[] o1,
double[] o2) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public DoubleArrayComparator(int idx)
idx
- the index of the element which should be used to compare two arrayspublic int compare(double[] o1, double[] o2)
compare
in interface Comparator<double[]>