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

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

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

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Manages the addition, removal, and modification of Task instances.

Author:
Brian Ellis


Public Member Functions

void addTasklikeObject (TasklikeObject t)
 Adds a task to be managed by the task manager.
int countTasks ()
 Counts the number of tasks currently being managed.
TasklikeObject getTasklikeObject (TasklikeObject t)
 Gets the given tasklike object in this manager if it exists.
TasklikeObject[] getTasks ()
 Returns an array containing all the tasks in the manager.
boolean hasTask (TasklikeObject t)
 Returns whether or not the manager is managing the given task.
void noteCompletenessChanged (Task t, boolean wasComplete, boolean isComplete)
 Called by a Task when its completeness is changed so that the manager can notify all interested parties of the change.
void noteStarrednessChanged (Task t, boolean wasStarred, boolean isStarred)
 Called by a Task when its starredness (or "whether or not it's starred", for those among us with a healthy respect for English) is changed so that the manager can notify all interested parties of the change.
void noteTaskDueDateChanged (Task t, Calendar oldDueDate, Calendar newDueDate)
 Called by a Task when its due date is changed so that the manager can notify all interested parties of the change.
void noteTaskGroupTasksChanged (TaskGroup t, List< Task > oldSubtasks, List< Task > newSubtasks)
 Called by a Task when its associated subtasks are changed so that the manager can notify all interested parties of the change.
void noteTaskNameChanged (Task t, String oldName, String newName)
 Called by a Task when its name is changed so that the manager can notify all interested parties of the change.
void noteTaskPendingStateChanged (Task t, PendingState oldPendingState, PendingState newPendingState)
 Called by a Task when its pending state is changed so that the manager can notify all interested parties of the change.
void noteTaskPriorityChanged (Task t, double oldPriority, double newPriority)
 Called by a Task when its priority is changed so that the manager can notify all interested parties of the change.
void noteTaskProjectChanged (Task t, Project oldProject, Project newProject)
 Called by a Task when its associated project is changed so that the manager can notify all interested parties of the change.
void noteTaskResourcesChanged (Task t, ResourceList oldResources, ResourceList newResources)
 Called by a Task when its associated resources are changed so that the manager can notify all interested parties of the change.
void noteTaskTagsChanged (Task t, Set< String > oldTags, HashSet< String > newTags)
 Called by a Task when its associated tags are changed so that the manager can notify all interested parties of the change.
void removeTasklikeObject (TasklikeObject t)
 Removes the given task from being managed by this manager.
void reset ()
 Resets this manager back to the way it was when it was first created.
Iterator< TasklikeObjecttaskIterator ()
 Returns an iterator, sorted by priority, over the tasks managed by the manager.
String toString ()
 Returns a string representation of this TaskManager.
void noteDateCompletedChanged (Task t, Calendar oldDateCompleted, Calendar newDateCompleted)
 Called by a Task when its date completed is changed so that the manager can notify all interested parties of the change.

Static Public Member Functions

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

Private Member Functions

 TaskManager ()
 Constructs the TaskManager instance.
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< TasklikeObjecttasks
 The actual task list, sorted by priority.

Static Private Attributes

static final long serialVersionUID = -5072485063150524741L
 Prevents serialization collisons.
static TaskManager uniqueInstance = null
 The singleton instance of the task manager.


Constructor & Destructor Documentation

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

Constructs the TaskManager instance.

Private because this is a singleton.


Member Function Documentation

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

Returns the singleton instance of this manager.

Returns:
the singleton instance

void edu.cmu.hcii.calo.manager.TaskManager.addTasklikeObject ( TasklikeObject  t  ) 

Adds a task to be managed by the task manager.

Parameters:
t the task to add
See also:
java.util.Set.add(java.lang.Object)

int edu.cmu.hcii.calo.manager.TaskManager.countTasks (  ) 

Counts the number of tasks currently being managed.

Returns:
the number of tasks being managed
See also:
java.util.Set.size()

TasklikeObject edu.cmu.hcii.calo.manager.TaskManager.getTasklikeObject ( TasklikeObject  t  ) 

Gets the given tasklike object in this manager if it exists.

Otherwise, return null.

Parameters:
t the tasklike object to get
Returns:
the tasklike object if it is found, null otherwise

TasklikeObject [] edu.cmu.hcii.calo.manager.TaskManager.getTasks (  ) 

Returns an array containing all the tasks in the manager.

Use this instead of taskIterator() to avoid concurrent modification due to threading issues, if that's your thing.

Returns:
the tasks currently in the manager

boolean edu.cmu.hcii.calo.manager.TaskManager.hasTask ( TasklikeObject  t  ) 

Returns whether or not the manager is managing the given task.

Parameters:
t the task to ask about
Returns:
true if the task is present, false otherwise
See also:
java.util.Set.contains(java.lang.Object)

void edu.cmu.hcii.calo.manager.TaskManager.noteCompletenessChanged ( Task  t,
boolean  wasComplete,
boolean  isComplete 
)

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

Parameters:
t the task whose completeness changed
wasComplete was the task complete before?
isComplete is it now?

void edu.cmu.hcii.calo.manager.TaskManager.noteStarrednessChanged ( Task  t,
boolean  wasStarred,
boolean  isStarred 
)

Called by a Task when its starredness (or "whether or not it's starred", for those among us with a healthy respect for English) is changed so that the manager can notify all interested parties of the change.

Parameters:
t the task whose starredness changed
wasStarred was the task starred before?
isStarred is it now?

void edu.cmu.hcii.calo.manager.TaskManager.noteTaskDueDateChanged ( Task  t,
Calendar  oldDueDate,
Calendar  newDueDate 
)

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

Parameters:
t the task that has been altered
oldDueDate the former due date of this task
newDueDate the new due date of this task

void edu.cmu.hcii.calo.manager.TaskManager.noteTaskGroupTasksChanged ( TaskGroup  t,
List< Task oldSubtasks,
List< Task newSubtasks 
)

Called by a Task when its associated subtasks are changed so that the manager can notify all interested parties of the change.

Parameters:
t the task that has been altered
oldSubtasks the old subtasks of the task
newSubtasks the new subtasks of the task

void edu.cmu.hcii.calo.manager.TaskManager.noteTaskNameChanged ( Task  t,
String  oldName,
String  newName 
)

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

Parameters:
t the task that has been altered
oldName the former name of this task
newName the new name of this task

void edu.cmu.hcii.calo.manager.TaskManager.noteTaskPendingStateChanged ( Task  t,
PendingState  oldPendingState,
PendingState  newPendingState 
)

Called by a Task when its pending state is changed so that the manager can notify all interested parties of the change.

Parameters:
t the task that has been altered
oldPendingState the old pending state of the task
newPendingState the new pending state of the task

void edu.cmu.hcii.calo.manager.TaskManager.noteTaskPriorityChanged ( Task  t,
double  oldPriority,
double  newPriority 
)

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

Parameters:
t the task that has been altered
oldPriority the former priority of this task
newPriority the new priority of this task

void edu.cmu.hcii.calo.manager.TaskManager.noteTaskProjectChanged ( Task  t,
Project  oldProject,
Project  newProject 
)

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

Parameters:
t the task that has been altered
oldProject the old project of the task
newProject the new project of the task

void edu.cmu.hcii.calo.manager.TaskManager.noteTaskResourcesChanged ( Task  t,
ResourceList  oldResources,
ResourceList  newResources 
)

Called by a Task when its associated resources are changed so that the manager can notify all interested parties of the change.

Parameters:
t the task that has been altered
oldResources the old resources associated with the task
newResources the new resources associated with the task

void edu.cmu.hcii.calo.manager.TaskManager.noteTaskTagsChanged ( Task  t,
Set< String >  oldTags,
HashSet< String >  newTags 
)

Called by a Task when its associated tags are changed so that the manager can notify all interested parties of the change.

Parameters:
t the task that has been altered
oldTags the old tags of the task
newTags the new tags of the task

void edu.cmu.hcii.calo.manager.TaskManager.removeTasklikeObject ( TasklikeObject  t  ) 

Removes the given task from being managed by this manager.

Parameters:
t the task to remove
See also:
java.util.Set.remove(java.lang.Object)

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

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

Todo:
Remove me after testing.

Iterator<TasklikeObject> edu.cmu.hcii.calo.manager.TaskManager.taskIterator (  ) 

Returns an iterator, sorted by priority, over the tasks managed by the manager.

Returns:
an iterator to the managed tasks
See also:
java.util.Set.iterator()

String edu.cmu.hcii.calo.manager.TaskManager.toString (  ) 

Returns a string representation of this TaskManager.

Useful only for debugging.

See also:
java.lang.Object.toString()

void edu.cmu.hcii.calo.manager.TaskManager.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.TaskManager.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 

void edu.cmu.hcii.calo.manager.TaskManager.noteDateCompletedChanged ( Task  t,
Calendar  oldDateCompleted,
Calendar  newDateCompleted 
)

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

Parameters:
t the task that has been altered
oldDateCompleted the old date completed of the task
newDateCompleted the new date completed of the task


Member Data Documentation

final long edu.cmu.hcii.calo.manager.TaskManager.serialVersionUID = -5072485063150524741L [static, private]

Prevents serialization collisons.

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

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

The singleton instance of the task manager.

MutableSortedSet<TasklikeObject> edu.cmu.hcii.calo.manager.TaskManager.tasks [private]

The actual task list, sorted by priority.


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