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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(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, waitMethods 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:
comparein 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
-