public class ToleranceDoubleComparator extends Object implements Comparator<Double>
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_EPSILON
Default tolerance used by the comparator.
|
Constructor and Description |
---|
ToleranceDoubleComparator()
Construct a new comparator with a
DEFAULT_EPSILON tolerance. |
ToleranceDoubleComparator(double epsilon)
Construct a new comparator with a specified tolerance.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(Double o1,
Double o2)
Compares two floating point values.
|
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 static final double DEFAULT_EPSILON
public ToleranceDoubleComparator()
DEFAULT_EPSILON
tolerance.public ToleranceDoubleComparator(double epsilon)
epsilon
- the tolerancepublic int compare(Double o1, Double o2)
compare
in interface Comparator<Double>
o1
- the first valueo2
- the second valueCopyright © 2017. All rights reserved.