de.jstacs.utils
Class DoubleArrayComparator
java.lang.Object
de.jstacs.utils.DoubleArrayComparator
- All Implemented Interfaces:
- Comparator<double[]>
public class DoubleArrayComparator
- extends Object
- implements Comparator<double[]>
This class implements a 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.
- Author:
- Jens Keilwagen
Constructor Summary |
DoubleArrayComparator(int idx)
Creates a new instance with a specific index for comparing double arrays. |
Method Summary |
int |
compare(double[] o1,
double[] o2)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DoubleArrayComparator
public DoubleArrayComparator(int idx)
- Creates a new instance with a specific index for comparing double arrays.
- Parameters:
idx
- the index of the element which should be used to compare two arrays
compare
public int compare(double[] o1,
double[] o2)
- Specified by:
compare
in interface Comparator<double[]>