/**
 * This class implements a Square, which is defined by an upper-left corner,
 * plus a side.
 * @author fpereira
 *
 */
public class Square extends Rectangle {

  /**
   * Constructor.
   * @param xp The X coordinate of the upper-left corner.
   * @param yp The Y coordinate of the upper-left corner.
   * @param sp The size of the square's side.
   */
  public Square(final int xp, final int yp, final int sp) {
    super(xp, yp, sp, sp);
  }

  /**
   * This method sets the width of the square.
   * @param newW the new width.
   */
  public void setWidth(int newW) {
    super.setWidth(newW);
    super.setHeight(newW);
  }

  /**
   * This method sets the height of the rectangle.
   * @param newH the new height.
   */
  public void setHeight(int newH) {
    super.setWidth(newH);
    super.setHeight(newH);
  }
}
