import java.util.Date;
/**
 * DayPlan models the behaviour of a single day's
 * plan or schedule.
 */
public class DayPlan {
  
  /**
   * number of events in this DayPlan
   */
  private int numEvents= 0;
  
  /**
   * this DayPlan's list of events
   */
  private String eventList= "";
  
  /**
   * this DayPlan's Date
   */
  private Date date;
  
  /**
   * how many DayPlans are there?
   */
  private static int dayPlanCount;
  
  /**
   * create a DayPlan with Date d
   */
  public DayPlan(Date d) {
    date= d;
    dayPlanCount= dayPlanCount + 1;
  }
  
  /**
   * empty constructor
   */
  public DayPlan() {
    date= new Date();
    dayPlanCount= dayPlanCount + 1;
  }
    
  /**
   * set this DayPlan's Date.
   */
  public void setDate(Date d) {
    date= d;
  }
  
  /**
   * what is this DayPlan's Date
   */
  public Date getDate() {
    return date;
  }
  
  /**
   * add an event to this DayPlan
   */
  public void addEvent(String event) {
    eventList= eventList + event + "\n";
    numEvents= numEvents + 1;
  }
  
  /**
   * remove event n from this DayPlan's events list
   */
  public void removeEvent(int n) {
  }
  
  /**
   * return this DayPlan's events as a String
   */
  public String showEvents() {
    return eventList;
  }
   /**tell us how many events there are
   */
  public int getNumEvents() { 
    return numEvents;
  }
  
  /**
   * report the number of DayPlans
   */
  public static int getDayPlanCount() {
    return dayPlanCount;
  }
  
  /**
   * represent this DayPlan as an
   * informative String.
   */
  public String toString() {
    String result= "Date:\n";
    result= result + date.toString();
    result= result + "\nEvents:\n";
    result= result + eventList;
    result= result + "\nNumber of events:\n";
    result= result + numEvents;
    return result;
  }
  
}