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.
   * 
   * @param d The date this Dayplan is initialized to.
   */
  public DayPlan(Date d) {
    date= d;
    dayPlanCount= dayPlanCount + 1;
  }
  
  /**
   * empty constructor
   */
  public DayPlan() {
    date= new Date();
    dayPlanCount= dayPlanCount + 1;
  }
    
  /**
   * set this DayPlan's Date.
   * 
   * @param d Set this Dayplan's date to d.
   */
  public void setDate(Date d) {
    date= d;
  }
  
  /**
   * what is this DayPlan's Date
   * 
   * @return The date this DayPlan is set to.
   */
  public Date getDate() {
    return date;
  }
  
  /**
   * add an event to this DayPlan
   * 
   * @param event A single-line String describing
   *         an event.
   */
  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
   * 
   * @return A list of this DayPlan's events.
   */
  public String showEvents() {
    return eventList;
  }
   /**tell us how many events there are
    * 
    * @return The number of events in this DayPlan.
   */
  public int getNumEvents() { 
    return numEvents;
  }
  
  /**
   * report the number of DayPlans
   * 
   * @return The number of DayPlans that have
   * been created.
   */
  public static int getDayPlanCount() {
    return dayPlanCount;
  }
  
  /**
   * represent this DayPlan as an
   * informative String.
   * 
   * @return an informative description of this
   * DayPlan.
   */
  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;
  }
  
}