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