1 public abstract class GeometricObject {
2 private String color = "white";
3 private boolean filled;
4 private java.util.Date dateCreated;
5
6
7 protected GeometricObject() {
8 dateCreated = new java.util.Date();
9 }
10
11
12 protected GeometricObject(String color, boolean filled) {
13 dateCreated = new java.util.Date();
14 this.color = color;
15 this.filled = filled;
16 }
17
18
19 public String getColor() {
20 return color;
21 }
22
23
24 public void setColor(String color) {
25 this.color = color;
26 }
27
28
30 public boolean isFilled() {
31 return filled;
32 }
33
34
35 public void setFilled(boolean filled) {
36 this.filled = filled;
37 }
38
39
40 public java.util.Date getDateCreated() {
41 return dateCreated;
42 }
43
44 @Override
45 public String toString() {
46 return "created on " + dateCreated + "\ncolor: " + color +
47 " and filled: " + filled;
48 }
49
50
51 public abstract double getArea();
52
53
54 public abstract double getPerimeter();
55 }