goldman.collection.spatial
Class XComparator

java.lang.Object
  extended by 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.


Constructor Summary
XComparator()
           
 
Method Summary
 int compare(Point p1, Point p2)
           
 
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
 

Constructor Detail

XComparator

public XComparator()
Method Detail

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