What happened if I sort a Java array with criteria based on its element?
Point[] points = new Point[10];
Arrays.sort(temp, points[0].SLOPE_ORDER);
Will this be a recursive call?
SLOPE_ORDER is a comparator:
public final Comparator<Point> SLOPE_ORDER = new SlopeOrder(); // YOUR DEFINITION HERE
private class SlopeOrder implements Comparator<Point>
{
public int compare(Point p1, Point p2)
{
...
}
}
points[0].SLOPE_ORDER?