/**
 * PIMTodo class
 *
 * a PIMTodo includes a todo description (string)
 * and a date.
 */

import java.util.*;
import java.text.*;

public class PIMTodo extends PIMEntity implements PIMDateable {
  String theTodo;
  Date theDate;


  /**
   * default constructor should probably not be used (it sets all the fields
   * to default values, this is probably not useful...)
   */

  PIMTodo() {
	super();
	theTodo="default";
	theDate = new Date();
  }


  /**
   * useful constructor, all field values are specified.
   *
   * @param todo is the description of the todo item
   * @param d is the date 
   * @param priority is the priority string
   * @param owner is the name of the owner
   * @param shared indicates whether this is public or private
   */

  PIMTodo(String todo, Date d, 
		  String priority, String owner, boolean shared) {
	super(priority,owner,shared);
	theTodo = todo;
	theDate = d;
  }

  /**
   * accessor method returns the todo string
   */

  public String getTodo() {
	return theTodo;
  }

  /**
   * Set the todo description string
   */

  public void setTodo(String t) {
	theTodo = t;
  }


  /**
   * date accessor method returns a Date object 
   */

  public Date getDate() {
	return theDate;
  }

  /**
   * changes the date associated with the appointment 
   */

  public void setDate(Date d) {
	theDate = d;
  }

  /** 
   * returns a string that contains all the fields formatted for printing.
   */

  public String toString() {
	return "-------PIMTodo------\n" +
	  "Todo: " + theTodo + "\n" + 
	  "Date: " + DateFormat.getDateInstance(DateFormat.SHORT).format(theDate) + "\n" +
	  super.toString();
  }


}

