|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vividsolutions.jts.geom.CoordinateSequenceComparator
Compares two 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.
| Field Summary | |
protected int |
dimensionLimit
The number of dimensions to test |
| Constructor Summary | |
CoordinateSequenceComparator()
Creates a comparator which will test all dimensions. |
|
CoordinateSequenceComparator(int dimensionLimit)
Creates a comparator which will test only the specified number of dimensions. |
|
| Method Summary | |
static int |
compare(double a,
double b)
Compare two doubles, allowing for NaN values. |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares two CoordinateSequences for relative order. |
protected int |
compareCoordinate(CoordinateSequence s1,
CoordinateSequence s2,
int i,
int dimension)
Compares the same coordinate of two CoordinateSequences
along the given number of dimensions. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
equals |
| Field Detail |
protected int dimensionLimit
| Constructor Detail |
public CoordinateSequenceComparator()
public CoordinateSequenceComparator(int dimensionLimit)
dimensionLimit - the number of dimensions to test| Method Detail |
public 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 double
public int compare(java.lang.Object o1,
java.lang.Object o2)
CoordinateSequences for relative order.
compare in interface java.util.Comparatoro1 - a CoordinateSequenceo2 - a CoordinateSequence
protected int compareCoordinate(CoordinateSequence s1,
CoordinateSequence s2,
int i,
int dimension)
CoordinateSequences
along the given number of dimensions.
s1 - a CoordinateSequences2 - a CoordinateSequencei - the index of the coordinate to testdimension - the number of dimensiosn to test
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||