package caltool.model.schedule; import caltool.model.caldb.*; import mvp.Model; /**** * * A ScheduledItem is the generic definition for the types of items stored in a * calendar. The Title component is a brief description of what the item is * for. The StartOrDueDate and EndDate components indicate when the item is * scheduled. The Category component is used to organize items into related * color-coded categories. * * There are four specializations of ScheduledItem. They are Appointment, * Meeting, Event, and Task, q.q.v. * * @author Gene Fisher (gfisher@calpoly.edu) * @version 13apr15 * */ public abstract class ScheduledItem extends Model { /** * Construct an empty schduled item. */ public ScheduledItem() { super(); } /*-* * Access methods */ /** * Return the title */ public String getTitle() { return title; } /** * Return the . */ public Date getDate() { return startOrDueDate; } /** * Return the end date. */ public Date getEndDate() { return endDate; } /** * Return the category. */ public Category getCategory() { return category; } /*-* * Process methods */ /** * Return the unique lookup key for this. This method is specialized in * each subclasss per the unique key requirements described in class * UserCalendar. * */ public abstract ItemKey getKey(); /*-* * Derived data fields */ /** Brief description of the scheduled item */ protected String title; /** Date on which item is scheduled or due. The startOrDueDate is a multi-purpose field of ScheduledItem. Its purpose depends on whether an item is a Task and whether it is recurring (Events cannot recur). For non-recurring appointments and meetings, StartOrDueDate is used as the single date on which the item is scheduled. If the item is recurring, StartOrDueDate is the first date on which it occurs. For a non-recurring Task, StartOrDueDate is the single date the task is due. If the task is recurring, StartOrDueDate is the first date it is due. */ protected Date startOrDueDate; /** Last date on which item is scheduled or due. In recurring appointments, meetings, and tasks, the end date defines the last date on which the item will recur. In events, the end date defines the last date of a multi-day event. When the value of end date is empty, the StartOrDueDate component is interpreted as the single date on which the item occurs. */ protected Date endDate; /** Used to organize items into related color-coded categories */ protected Category category; }