![]() |
CS111 Rect Contract |
Instances of the Rect class are rectangles
situated in the standard Cartesian coordinate space.
Note that the Rect class is different from
the Rectangle class, which has a different contract.
Constructor Methods
public Rect (int llx, int lly, int width, int height);
Construct a Rect from with lower left point (llx,lly),
width width, and height height.
public Rect (Point ll, Point ur);
Construct a Rect with lower left point ll
and upper right point ur.
Instance Methods
public int width ();
Returns the width of this Rect.
public int height ();
Returns the height of this Rect.
public Point lowerLeft ();
Returns the lower left point of this Rect.
public Point upperRight ();
Returns the upper right point of this Rect.