public class Circle implements MyComparable{ private Point origin; private int radius; public Circle(Point origin, int radius) { this.origin = origin; this.radius = radius; } public void setOrigin(Point newOrigin) { origin = newOrigin; } public Point getOrigin() { return origin; } public void setRadius(int newRadius ) { radius = newRadius; } public int getRadius() { return radius; } public double getArea() { return 3.14159 * radius * radius; } @Override public boolean isLarger(MyComparable other) throws InvalidComparableTypeException { if( other instanceof Circle ) { Circle otherRect = (Circle) other; return (this.getArea() > otherRect.getArea()); } throw new InvalidComparableTypeException(); } @Override public boolean isEqual(MyComparable other) throws InvalidComparableTypeException { if( other instanceof Circle ) { Circle otherRect = (Circle) other; return (this.getArea() == otherRect.getArea()); } throw new InvalidComparableTypeException(); } public String toString() { return origin.toString()+" radius: "+radius; } }