forked from softwareconstruction240/softwareconstruction
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRectangle.java
More file actions
35 lines (27 loc) · 691 Bytes
/
Rectangle.java
File metadata and controls
35 lines (27 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class Rectangle {
private Point topLeft;
private Point bottomRight;
public Rectangle() {
topLeft = new Point(0, 0);
bottomRight = new Point(0, 0);
}
public Rectangle(Point tl, Point br) {
topLeft = tl;
bottomRight = br;
}
public Point getTopLeft() {
return topLeft;
}
public void setTopLeft(Point value) {
topLeft = value;
}
public Point getBottomRight() {
return bottomRight;
}
public void setBottomRight(Point value) {
bottomRight = value;
}
public String toString() {
return String.format("Rectangle[%s, %s]", topLeft, bottomRight);
}
}