com.strangelight.servlets.TaskMaster
Class TaskTree

java.lang.Object
  |
  +--com.strangelight.servlets.TaskMaster.TaskTree

public final class TaskTree
extends java.lang.Object

Task encapsulates a single "task", which can contain multiple subtasks.


Constructor Summary
TaskTree(java.lang.String u)
          Gets the TaskTree associated with a particular user.
 
Method Summary
 void commit()
          Writes any changes made to Tasks in the TaskTree back to disk.
protected  java.lang.String generate_unique_id()
          Generates a unique Task id.
 Task get_task(java.lang.String id)
          retrieve a Task object with the specified id.
 Task getRootTask()
          Gets the root of this TaskTree.
protected  void register(Task task)
          Registers this Task as part of this Task tree.
protected  void remove(Task task)
          Removes this Task from the Task tree.
 java.lang.String u()
          Gets the "u value" (user hash code) for this TaskTree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskTree

public TaskTree(java.lang.String u)
         throws E_NoSuchU
Gets the TaskTree associated with a particular user.

Method Detail

u

public java.lang.String u()
Gets the "u value" (user hash code) for this TaskTree.


getRootTask

public Task getRootTask()
Gets the root of this TaskTree.


get_task

public Task get_task(java.lang.String id)
retrieve a Task object with the specified id.

Parameters:
id - the unique id String of the Task object that we want to retrieve.
Returns:
the Task object with the specified id, or null if no such object exists.
See Also:
#get_id()

generate_unique_id

protected java.lang.String generate_unique_id()
Generates a unique Task id.

Note that this method is not synchronized, and should normally be called from a block that synchronizes on this TaskTree object, to prevent different threads from getting duplicate keys.


remove

protected void remove(Task task)
Removes this Task from the Task tree.


register

protected void register(Task task)
Registers this Task as part of this Task tree. (Must be called whenever a Task is added to the tree.)


commit

public void commit()
Writes any changes made to Tasks in the TaskTree back to disk.