package lectures.deep_shallow_copy;
import util.annotations.WebDocuments;

import lectures.inheritance.is_a.extra.ABoundedPoint;

@WebDocuments({"Lectures/DeepShallowCopy.pptx", "Lectures/DeepShallowCopy.pdf", "Videos/DeepShallowCopy.avi"})
public class ACloneableBoundedPoint extends ABoundedPoint implements CloneableBoundedPoint, Cloneable { 
    public ACloneableBoundedPoint(int initX, int initY,
            CloneablePoint theUpperLeftCorner, CloneablePoint theLowerRightCorner) {
        super(initX, initY, theUpperLeftCorner, theLowerRightCorner);
    }

    public Object clone() {
        try {
            return super.clone();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    public CloneableBoundedPoint deepCopy() {
        return  new ACloneableBoundedPoint (x, y, 
                (CloneablePoint) ((CloneablePoint) upperLeftCorner).clone(), 
                (CloneablePoint) ((CloneablePoint)lowerRightCorner).clone()); 
    }
}