java.util.Comparator
public class CoordinateSequenceComparator
extends java.lang.Object
implements java.util.Comparator
CoordinateSequence
s.
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 | 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 | 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
CoordinateSequence s for relative order. |
public CoordinateSequenceComparator()
public CoordinateSequenceComparator(int dimensionLimit)
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)
CoordinateSequence
s for relative order.compare
in interface java.util.Comparator
o1
- a CoordinateSequence
o2
- a CoordinateSequence
Copyright © 2018. All rights reserved.