public class ToleranceDoubleComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.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(java.lang.Double o1,
java.lang.Double o2)
Compares two floating point values.
|
public static final double DEFAULT_EPSILON
public ToleranceDoubleComparator()
DEFAULT_EPSILON tolerance.public ToleranceDoubleComparator(double epsilon)
epsilon - the tolerancepublic int compare(java.lang.Double o1,
java.lang.Double o2)
compare in interface java.util.Comparator<java.lang.Double>o1 - the first valueo2 - the second valueCopyright © 2019. All Rights Reserved.