com.vividsolutions.jts.geom
public static class Coordinate.DimensionalComparator extends java.lang.Object implements java.util.Comparator
Coordinate
s, allowing for either a 2-dimensional
or 3-dimensional comparison, and handling NaN values correctly.Constructor and Description |
---|
Coordinate.DimensionalComparator()
Creates a comparator for 2 dimensional coordinates.
|
Coordinate.DimensionalComparator(int dimensionsToTest)
Creates a comparator for 2 or 3 dimensional coordinates, depending
on the value provided.
|
Modifier and Type | Method and Description |
---|---|
static int |
compare(double a,
double b)
Compare two
double s, allowing for NaN values. |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares two
Coordinate s along to the number of
dimensions specified. |
public Coordinate.DimensionalComparator()
public Coordinate.DimensionalComparator(int dimensionsToTest)
dimensionLimit
- the number of dimensions to testpublic static int compare(double a, double b)
double
s, allowing for NaN values.
NaN is treated as being less than any valid number.a
- a double
b
- a double
public int compare(java.lang.Object o1, java.lang.Object o2)
Coordinate
s along to the number of
dimensions specified.compare
in interface java.util.Comparator
o1
- a Coordinate
o2
- a {link Coordinate}