public abstract class Calendar
extends java.lang.Object
The data component of a Calendar is a collection of scheduled items. The operations are those that schedule each of the four types of scheduled item. In the case of meetings, there are two operations involved -- one to compute a list of possible times, and another to confirm a specific selected meeting time.
Modifier and Type | Field and Description |
---|---|
(package private) java.util.Collection<ScheduledItem> |
data |
Constructor and Description |
---|
Calendar() |
Modifier and Type | Method and Description |
---|---|
(package private) abstract void |
confirmMeeting(MeetingRequest request,
schedule.PossibleMeetingTimes times,
int selectedTime)
ConfirmMeeting takes a MeetingRequest, list of PossibleMeetingTimes, and
a Selected time from the list.
|
(package private) abstract void |
scheduleAppointment(Appointment appointment)
ScheduleAppointment adds the given Appointment to this.data, if an
appointment of the same time, duration, and title is not already
scheduled.
|
(package private) abstract void |
scheduleEvent(Event event)
ScheduleEvent adds the given Event to this.data, if an event of the same
time, duration, and title is not already scheduled.
|
(package private) abstract schedule.PossibleMeetingTimes |
scheduleMeeting(MeetingRequest meetingRequest)
ScheduleMeeting uses the given MeetingRequest to determine possible
times that the requested meeting might be held, within the existing set
of scheduled items in the this.data.
|
(package private) abstract void |
scheduleTask(Task task)
ScheduleTask adds the given Task to this.data, if a task of the same
time, duration, and title is not already scheduled.
|
java.util.Collection<ScheduledItem> data
abstract void scheduleAppointment(Appointment appointment)
abstract schedule.PossibleMeetingTimes scheduleMeeting(MeetingRequest meetingRequest)
abstract void confirmMeeting(MeetingRequest request, schedule.PossibleMeetingTimes times, int selectedTime)
abstract void scheduleTask(Task task)
abstract void scheduleEvent(Event event)
pre: // // The Title field is not empty. // (event.title != null && event.title.length() >= 1) && // // The startOrDueDate field is a valid date value. // (event.startOrDueDate != null) && event.startOrDueDate.isValid() && // // If non-empty, the EndDate field is a valid date value. // (event.endDate != null) ==> event.endDate.isValid() && // // No event of same startDate and title is in the current calendar. // ! exists (ScheduledItem item ; data.contains(item) ; (item.startOrDueDate.equals(event.startOrDueDate)) && (item.title.equals(event.title))); post: // // If preconds met, a scheduled item is in the output calendar if // and only if it is the new appt to be added or it is in the // input calendar. // forall (ScheduledItem item; data'.contains(item) iff (item == event || data.contains(item)));