edu.cmu.hcii.calo.manager.ScheduleManager Class Reference

Inherits edu.cmu.hcii.calo.manager.AbstractManager.

Inheritance diagram for edu.cmu.hcii.calo.manager.ScheduleManager:

Inheritance graph
[legend]
Collaboration diagram for edu.cmu.hcii.calo.manager.ScheduleManager:

Collaboration graph
[legend]
List of all members.

Detailed Description

Manages the addition, removal, and modification of items on the schedule.

Author:
Brian Ellis


Public Member Functions

void addItem (ScheduleItem o)
 Adds a ScheduleItem to the schedule.
int countItems ()
 Returns the number of items currently in the schedule.
ScheduleItem earliestItem ()
 Retrieves the ScheduleItem with the earliest start time.
boolean hasScheduleItem (ScheduleItem o)
 Checks whether the given ScheduleItem is currently being managed by this manager.
ScheduleItem latestItem ()
 Retrieves the ScheduleItem with the latest start time.
void noteItemChanged (ScheduleItem item)
 Called by a ScheduleItem when its state has generically changed so that the manager can notify all interested parties of the change.
void noteItemEndTimeChanged (ScheduleItem item, Calendar oldEndTime, Calendar newEndTime)
 Called by a ScheduleItem when its end time is changed so that the manager can notify all interested parties of the change.
void noteItemHasReminderChanged (ScheduleItem item, boolean oldHasReminder, boolean newHasReminder)
 Called by a ScheduleItem when its reminder status is changed so that the manager can notify all interested parties of the change.
void noteItemNameChanged (ScheduleItem item, String oldName, String name)
 Called by a ScheduledItem when its due date is changed so that the manager can notify all interested parties of the change.
void noteItemProjectChanged (ScheduleItem item, Project oldProject, Project newProject)
 Called by a ScheduleItem when its project is changed so that the manager can notify all interested parties of the change.
void noteItemStartTimeChanged (ScheduleItem item, Calendar oldStartTime, Calendar newStartTime)
 Called by a ScheduleItem when its start time is changed so that the manager can notify all interested parties of the change.
void removeItem (ScheduleItem o)
 Removes a ScheduleItem from the schedule.
void reset ()
 Resets this manager back to the way it was when it was first created.
Iterator< ScheduleItemscheduleIterator ()
 Retrieves an iterator over all the ScheduleItems in the schedule.

Static Public Member Functions

static ScheduleManager getManager ()
 Returns the singleton instance of this manager.

Private Member Functions

 ScheduleManager ()
 Constructs a new ScheduleManager.
void readObject (java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
 Reads in a serialized manager.
void writeObject (java.io.ObjectOutputStream out) throws IOException
 Writes this manager to stream.

Private Attributes

MutableSortedSet< ScheduleItemscheduledItems
 The items managed by this schedule manager.

Static Private Attributes

static final long serialVersionUID = 8963616139767956524L
 Prevents serialization collisions.
static ScheduleManager uniqueInstance = null
 The singleton instance of the notification manager.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.manager.ScheduleManager.ScheduleManager (  )  [private]

Constructs a new ScheduleManager.

Private because this is a singleton.


Member Function Documentation

static ScheduleManager edu.cmu.hcii.calo.manager.ScheduleManager.getManager (  )  [static]

Returns the singleton instance of this manager.

Returns:
the singleton instance

void edu.cmu.hcii.calo.manager.ScheduleManager.addItem ( ScheduleItem  o  ) 

Adds a ScheduleItem to the schedule.

Parameters:
o the item to add
See also:
java.util.Set.add(java.lang.Object)

int edu.cmu.hcii.calo.manager.ScheduleManager.countItems (  ) 

Returns the number of items currently in the schedule.

Returns:
the number of items in the schedule
See also:
java.util.Set.size()

ScheduleItem edu.cmu.hcii.calo.manager.ScheduleManager.earliestItem (  ) 

Retrieves the ScheduleItem with the earliest start time.

Returns:
the earliest item in the schedule
See also:
java.util.SortedSet.first()

boolean edu.cmu.hcii.calo.manager.ScheduleManager.hasScheduleItem ( ScheduleItem  o  ) 

Checks whether the given ScheduleItem is currently being managed by this manager.

Parameters:
o the ScheduleItem to check for
Returns:
true if the item exists, false otherwise
See also:
java.util.Set.contains(java.lang.Object)

ScheduleItem edu.cmu.hcii.calo.manager.ScheduleManager.latestItem (  ) 

Retrieves the ScheduleItem with the latest start time.

Returns:
the latest item in the schedule
See also:
java.util.SortedSet.last()

void edu.cmu.hcii.calo.manager.ScheduleManager.noteItemChanged ( ScheduleItem  item  ) 

Called by a ScheduleItem when its state has generically changed so that the manager can notify all interested parties of the change.

Parameters:
item the ScheduleItem that has been altered

void edu.cmu.hcii.calo.manager.ScheduleManager.noteItemEndTimeChanged ( ScheduleItem  item,
Calendar  oldEndTime,
Calendar  newEndTime 
)

Called by a ScheduleItem when its end time is changed so that the manager can notify all interested parties of the change.

Parameters:
item the ScheduleItem that has been altered
oldEndTime the former end time of this ScheduleItem
newEndTime the new end time of this ScheduleItem

void edu.cmu.hcii.calo.manager.ScheduleManager.noteItemHasReminderChanged ( ScheduleItem  item,
boolean  oldHasReminder,
boolean  newHasReminder 
)

Called by a ScheduleItem when its reminder status is changed so that the manager can notify all interested parties of the change.

Parameters:
item the ScheduleItem that has been altered
oldHasReminder the former reminder status of this ScheduleItem
newHasReminder the new reminder status of this ScheduleItem

void edu.cmu.hcii.calo.manager.ScheduleManager.noteItemNameChanged ( ScheduleItem  item,
String  oldName,
String  name 
)

Called by a ScheduledItem when its due date is changed so that the manager can notify all interested parties of the change.

Parameters:
item the item that has been altered
oldName the former name of this item
name the new name of this item

void edu.cmu.hcii.calo.manager.ScheduleManager.noteItemProjectChanged ( ScheduleItem  item,
Project  oldProject,
Project  newProject 
)

Called by a ScheduleItem when its project is changed so that the manager can notify all interested parties of the change.

Parameters:
item the ScheduleItem that has been altered
oldProject the former project of this ScheduleItem
newProject the new project of this ScheduleItem

void edu.cmu.hcii.calo.manager.ScheduleManager.noteItemStartTimeChanged ( ScheduleItem  item,
Calendar  oldStartTime,
Calendar  newStartTime 
)

Called by a ScheduleItem when its start time is changed so that the manager can notify all interested parties of the change.

Parameters:
item the ScheduleItem that has been altered
oldStartTime the former start time of this ScheduleItem
newStartTime the new start time of this ScheduleItem

void edu.cmu.hcii.calo.manager.ScheduleManager.removeItem ( ScheduleItem  o  ) 

Removes a ScheduleItem from the schedule.

Parameters:
o the ScheduleItem to remove
See also:
java.util.Set.remove(java.lang.Object)

void edu.cmu.hcii.calo.manager.ScheduleManager.reset (  ) 

Resets this manager back to the way it was when it was first created.

Iterator<ScheduleItem> edu.cmu.hcii.calo.manager.ScheduleManager.scheduleIterator (  ) 

Retrieves an iterator over all the ScheduleItems in the schedule.

The iterator will return schedule items in order from earliest to latest start times.

Returns:
the schedule iterator
See also:
java.util.Set.iterator()

void edu.cmu.hcii.calo.manager.ScheduleManager.readObject ( java.io.ObjectInputStream  in  )  throws IOException, ClassNotFoundException [private]

Reads in a serialized manager.

Just checks against the serialVersionUID.

Parameters:
in the input stream to read from
Exceptions:
IOException 
ClassNotFoundException 

void edu.cmu.hcii.calo.manager.ScheduleManager.writeObject ( java.io.ObjectOutputStream  out  )  throws IOException [private]

Writes this manager to stream.

Since I don't want to deal with everything below this manager being serialized and it is a singleton, I just write the ID for error checking.

Parameters:
out the output stream to write to
Exceptions:
IOException 


Member Data Documentation

final long edu.cmu.hcii.calo.manager.ScheduleManager.serialVersionUID = 8963616139767956524L [static, private]

Prevents serialization collisions.

Reimplemented from edu.cmu.hcii.calo.manager.AbstractManager.

ScheduleManager edu.cmu.hcii.calo.manager.ScheduleManager.uniqueInstance = null [static, private]

The singleton instance of the notification manager.

MutableSortedSet<ScheduleItem> edu.cmu.hcii.calo.manager.ScheduleManager.scheduledItems [private]

The items managed by this schedule manager.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:15 2007 for CALO by  doxygen 1.5.2