import java.awt.geom.Ellipse2D;
public class Main {
/**
* Compares two ellipses and returns <code>true</code> if they are equal or
* both <code>null</code>.
*
* @param e1 the first ellipse (<code>null</code> permitted).
* @param e2 the second ellipse (<code>null</code> permitted).
*
* @return A boolean.
*/
public static boolean equal(final Ellipse2D e1, final Ellipse2D e2) {
if (e1 == null) {
return (e2 == null);
}
if (e2 == null) {
return false;
}
if (!e1.getFrame().equals(e2.getFrame())) {
return false;
}
return true;
}
}
|