/** * PIMAppointment class * * a PIMAppointment includes an appointment description (string) * and a date. */ import java.util.*; import java.text.*; public class PIMAppointment extends PIMEntity implements PIMDateable { String theAppointment; Date theDate; /** * default constructor should probably not be used (it sets all the fields * to default values, this is probably not useful...) */ PIMAppointment() { super(); theAppointment = "default"; theDate = new Date(); } /** * useful constructor, all field values are specified. * * @param appt is the description of the appointment * @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 */ PIMAppointment(String appt, Date d, String priority, String owner, boolean shared) { super(priority,owner,shared); theAppointment = appt; theDate =d; } /** * 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; } /** * appointment text accessor methof */ public String getAppointment() { return theAppointment; } /** * change the appointment text */ public void setAppointment(String a) { theAppointment = a; } /** * returns a string that contains all the fields formatted for printing. */ public String toString() { return "-------PIMAppointment------\n" + "Appointment: " + theAppointment + "\n" + "Date: " + DateFormat.getDateInstance(DateFormat.SHORT).format(theDate) + "\n" + super.toString(); } }