/*
 * GeometricObject.java
 *
 * Created 10/30/06
 * Last modified 10/30/06
 */

package chapter9;

/** This class serves as a "superclass" used to derive several
 * "subclasses" in Chapter 9 of Liang, Introduction to Java
 * Programming: Fundamentals First, 6th edition. Some comments
 * have been modified.
 */
public class GeometricObject {

    // ---------------------------------------------------------------------
    // Instance variables (data fields)...

    private String color = "white";
    private boolean filled;
    private java.util.Date dateCreated;

    // ---------------------------------------------------------------------
    // Constructor(s)...
    
    public GeometricObject() {              // Default "no-args" constructor
        System.out.println ("Enter GeometricObject default constructor");
        dateCreated = new java.util.Date();
        System.out.println ("Exit GeometricObject default constructor");
    }

    // ---------------------------------------------------------------------
    // Methods ("getters", "setters", and others...)
    
    public String getColor() {
        return color;
    }

    public void setColor (String color) {
        this.color = color;
    }

    public boolean isFilled() {
        return filled;
    }
    
    public void setFilled (boolean filled) {
        this.filled = filled;
    }
    
    public java.util.Date getDateCreated() {
        return dateCreated;
    }
    
    public String toString() {
       return ("created on " + dateCreated + "\ncolor: " + color +
               " and filled: " + filled);
    }

}   // End of GeometricObject class definition
