You declare that your class implements Comparable<Rectangle>
but your code suggests your are comparing SimpleGeometricObject
s.
Also, what could help is the function Double.compare(double d1, double d2)
in the Double
class. (see the documentation)