Package org.plumelib.util
Class FuzzyFloat.DoubleArrayComparatorLexical
java.lang.Object
org.plumelib.util.FuzzyFloat.DoubleArrayComparatorLexical
- All Implemented Interfaces:
Serializable
,Comparator<double[]>
- Enclosing class:
- FuzzyFloat
public class FuzzyFloat.DoubleArrayComparatorLexical
extends Object
implements Comparator<double[]>, Serializable
Lexically compares two double arrays.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compare
(double[] a1, double[] a2) Lexically compares o1 and o2 as double arrays.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
DoubleArrayComparatorLexical
public DoubleArrayComparatorLexical()Create a new DoubleArrayComparatorLexical.
-
-
Method Details
-
compare
@Pure public int compare(double[] a1, double[] a2) Lexically compares o1 and o2 as double arrays.- Specified by:
compare
in interfaceComparator<double[]>
- Parameters:
a1
- the first array to comparea2
- the second array to compare- Returns:
- positive if o1 > 02, 0 if o1 == o2, negative if o1 < o2
-