@@ -0,0 +1,1280 @@
+package babySteps;%0A%0Aimport java.util.ArrayList;%0A%0A/**%0A * An encapsulation of a task and its subtasks. A B-tree structure is used.%0A * Each node is a task. A node's children are the more specific tasks required%0A * for completion.%0A * %0A * @author Elliot Penson%0A */%0Apublic class Task implements java.io.Serializable %7B%0A%09%0A%09private static final long serialVersionUID = 1L;%0A%0A%09/**%0A%09 * Name of the task.%0A%09 */%0A%09private String title;%0A%09%0A%09/**%0A%09 * Flag to indicate if the task has been finished.%0A%09 */%0A%09private boolean completed;%0A%09%0A%09/**%0A%09 * List of children that represent jobs within this task.%0A%09 */%0A%09private ArrayList%3CTask%3E subtasks;%0A%09%0A%09public Task(String title) %7B%0A%09%09this.title = title;%0A%09%09completed = false;%0A%09%09subtasks = new ArrayList%3CTask%3E();%0A%09%7D%0A%0A%09public String getTitle() %7B%0A%09%09return title;%0A%09%7D%0A%09%0A%09public void setTitle(String newTitle) %7B%0A%09%09title = newTitle;%0A%09%7D%0A%09%0A%09public boolean completed() %7B%0A%09%09return completed;%0A%09%7D%0A%09%0A%09public void setCompleted() %7B%0A%09%09completed = true;%0A%09%7D%0A%09%0A%09public void setUncompleted() %7B%0A%09%09completed = false;%0A%09%7D%0A%09%0A%09public void addSubtask(Task subtask) %7B%0A%09%09subtasks.add(subtask);%0A%09%7D%0A%09%0A%09public int numberOfSubtasks() %7B%0A%09%09return subtasks.size();%0A%09%7D%0A%09%0A%09public boolean hasSubtasks() %7B%0A%09%09return !subtasks.isEmpty();%0A%09%7D%0A%09%0A%09public ArrayList%3CTask%3E getSubtasks() %7B%0A%09%09return subtasks;%0A%09%7D%0A%7D%0A

Add Task class