edu.cmu.hcii.calo.model.TaskGroup Class Reference

Inherits edu.cmu.hcii.calo.model.TasklikeObject.

Inheritance diagram for edu.cmu.hcii.calo.model.TaskGroup:

Inheritance graph
[legend]
Collaboration diagram for edu.cmu.hcii.calo.model.TaskGroup:

Collaboration graph
[legend]
List of all members.

Detailed Description

A group of tasks.

The group has a priority based on its component subtasks as computed by the engine.

Author:
Brian Ellis


Public Member Functions

 TaskGroup ()
 Constructs a new TaskGroup.
boolean appendTask (Task task)
 Appends a Task onto the end of this task's tasks.
int countTasks ()
 Counts the number of tasks of this task.
Calendar getDateAdded ()
 Gets the date added of this TaskGroup.
double getPriority ()
 Returns the priority of this group, as computed by CALO.
Task getTaskAt (int index)
 Gets the Task at the given index.
List< TaskgetTasks ()
 Accessor method for tasks.
int indexOfTask (Task task)
 Returns the index of the given Task, or -1 if it's not in the list.
void insertTask (int index, Task task)
 Inserts a Task of this task at a given index.
void removeAllTasks ()
 Removes all tasks from this task.
boolean removeTask (Task task)
 Removes the given Task from this task's Task list, if it was present.
Task removeTaskAt (int index)
 Removes the Task of this task at the given index.
Task replaceTaskAt (int index, Task newTask)
 Replaces the Task of this task at the given index with the new Task.
Iterator< TaskTaskIterator ()
 Gets an iterator over this task's tasks.

Private Attributes

LinkedList< Tasktasks
 The list of tasks of this group, if any.

Static Private Attributes

static final long serialVersionUID = -1214130792328705063L
 To prevent serialization collisions.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.model.TaskGroup.TaskGroup (  ) 

Constructs a new TaskGroup.


Member Function Documentation

boolean edu.cmu.hcii.calo.model.TaskGroup.appendTask ( Task  task  ) 

Appends a Task onto the end of this task's tasks.

Parameters:
task the Task to add
Returns:
true if the task was not already there, false otherwise
See also:
java.util.List.add(java.lang.Object)

int edu.cmu.hcii.calo.model.TaskGroup.countTasks (  ) 

Counts the number of tasks of this task.

Returns:
the number of tasks of this task, with 0 meaning the task has no tasks
See also:
java.util.List.size()

Calendar edu.cmu.hcii.calo.model.TaskGroup.getDateAdded (  ) 

Gets the date added of this TaskGroup.

The "date added" of a TaskGroup is defined to be the date on which the oldest task in the group was added.

See also:
edu.cmu.hcii.calo.model.ManagedObject.getDateAdded()

Reimplemented from edu.cmu.hcii.calo.model.ManagedObject.

double edu.cmu.hcii.calo.model.TaskGroup.getPriority (  )  [virtual]

Returns the priority of this group, as computed by CALO.

Todo:
This should call into the engine to determine its priority!
See also:
edu.cmu.hcii.calo.model.Prioritizable.getPriority()

Implements edu.cmu.hcii.calo.model.PrioritizedObject.

Task edu.cmu.hcii.calo.model.TaskGroup.getTaskAt ( int  index  ) 

Gets the Task at the given index.

Parameters:
index the index to get
Returns:
the Task at that index
Exceptions:
IndexOutOfBoundsException if the index is invalid
See also:
java.util.List.get(int)

List<Task> edu.cmu.hcii.calo.model.TaskGroup.getTasks (  ) 

Accessor method for tasks.

Returns:
the value of tasks

int edu.cmu.hcii.calo.model.TaskGroup.indexOfTask ( Task  task  ) 

Returns the index of the given Task, or -1 if it's not in the list.

Parameters:
task the Task to look for
Returns:
the index, or -1 if the Task was not found
See also:
java.util.List.indexOf(java.lang.Object)

void edu.cmu.hcii.calo.model.TaskGroup.insertTask ( int  index,
Task  task 
)

Inserts a Task of this task at a given index.

Parameters:
index the index to insert the Task at
task the Task to insert
See also:
java.util.List.add(int, java.lang.Object)

void edu.cmu.hcii.calo.model.TaskGroup.removeAllTasks (  ) 

Removes all tasks from this task.

See also:
java.util.List.clear()

boolean edu.cmu.hcii.calo.model.TaskGroup.removeTask ( Task  task  ) 

Removes the given Task from this task's Task list, if it was present.

Parameters:
task the Task to remove
Returns:
true if this Task existed (and was removed), false otherwise
See also:
java.util.List.remove(java.lang.Object)

Task edu.cmu.hcii.calo.model.TaskGroup.removeTaskAt ( int  index  ) 

Removes the Task of this task at the given index.

Parameters:
index the index of the Task to remove
Returns:
the removed Task
Exceptions:
IndexOutOfBoundsException if the index is invalid
See also:
java.util.List.remove(int)

Task edu.cmu.hcii.calo.model.TaskGroup.replaceTaskAt ( int  index,
Task  newTask 
)

Replaces the Task of this task at the given index with the new Task.

Parameters:
index the index of the Task to remove
newTask the Task to replace it with
Returns:
the removed Task
Exceptions:
IndexOutOfBoundsException if the index is invalid
See also:
java.util.List.set(int, java.lang.Object)

Iterator<Task> edu.cmu.hcii.calo.model.TaskGroup.TaskIterator (  ) 

Gets an iterator over this task's tasks.

Returns:
the iterator
See also:
java.util.List.iterator()


Member Data Documentation

final long edu.cmu.hcii.calo.model.TaskGroup.serialVersionUID = -1214130792328705063L [static, private]

To prevent serialization collisions.

LinkedList<Task> edu.cmu.hcii.calo.model.TaskGroup.tasks [private]

The list of tasks of this group, if any.

If the task has no tasks, this list should be empty but non-null.


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