public class CoordinateSequenceComparator extends Object implements Comparator
CoordinateSequences.
For sequences of the same dimension, the ordering is lexicographic.
Otherwise, lower dimensions are sorted before higher.
The dimensions compared can be limited; if this is done
ordinate dimensions above the limit will not be compared.
If different behaviour is required for comparing size, dimension, or coordinate values, any or all methods can be overridden.
| Constructor and Description |
|---|
CoordinateSequenceComparator()
Creates a comparator which will test all dimensions.
|
CoordinateSequenceComparator(int dimensionLimit)
Creates a comparator which will test only the specified number of dimensions.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
compare(double a,
double b)
Compare two
doubles, allowing for NaN values. |
int |
compare(Object o1,
Object o2)
Compares two
CoordinateSequences for relative order. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic CoordinateSequenceComparator()
public CoordinateSequenceComparator(int dimensionLimit)
dimensionLimit - the number of dimensions to testpublic static int compare(double a,
double b)
doubles, allowing for NaN values.
NaN is treated as being less than any valid number.a - a doubleb - a doublepublic int compare(Object o1, Object o2)
CoordinateSequences for relative order.compare in interface Comparatoro1 - a CoordinateSequenceo2 - a CoordinateSequenceCopyright © 2024. All rights reserved.