goldman.collection.spatial
Class XComparator
java.lang.Object
goldman.collection.spatial.XComparator
- All Implemented Interfaces:
- Comparator<Point>
public class XComparator
- extends Object
- implements Comparator<Point>
Each dimension in a spatial collection requires its own comparator.
For example, the following XComparator uses x coordinates to compare points.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XComparator
public XComparator()
compare
public int compare(Point p1,
Point p2)
- Specified by:
compare
in interface Comparator<Point>
- Returns:
- a negative value if p1.x < p2.x, zero if p1.x = p2.x, and a positive value if p1.x > p2.x