Package org.jfree.data.gantt
Class Task
java.lang.Object
org.jfree.data.gantt.Task
public class Task extends Object
A simple representation of a task. The task has a description and a duration.
You can add sub-tasks to the task.
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidaddSubtask(Task subtask)Adds a sub-task to the task.StringgetDescription()Returns the task description.TimePeriodgetDuration()Returns the duration (actual or estimated) of the task.DoublegetPercentComplete()Returns the percentage complete for this task.TaskgetSubtask(int index)Returns a sub-task.intgetSubtaskCount()Returns the sub-task count.voidremoveSubtask(Task subtask)Removes a sub-task from the task.voidsetDescription(String description)Sets the task description.voidsetDuration(TimePeriod duration)Sets the task duration (actual or estimated).voidsetPercentComplete(double percent)Sets the percentage complete for the task.voidsetPercentComplete(Double percent)Sets the percentage complete for the task.
-
Constructor Details
-
Task
Creates a new task.- Parameters:
description- the task description.duration- the task duration.
-
Task
Creates a new task.- Parameters:
description- the task description.start- the start date.end- the end date.
-
-
Method Details
-
getDescription
Returns the task description.- Returns:
- The task description.
-
setDescription
Sets the task description.- Parameters:
description- the new description.
-
getDuration
Returns the duration (actual or estimated) of the task.- Returns:
- The task duration.
-
setDuration
Sets the task duration (actual or estimated).- Parameters:
duration- the duration.
-
getPercentComplete
Returns the percentage complete for this task.- Returns:
- The percentage complete (possibly
null).
-
setPercentComplete
public void setPercentComplete(double percent)Sets the percentage complete for the task.- Parameters:
percent- the percentage.
-
setPercentComplete
Sets the percentage complete for the task.- Parameters:
percent- the percentage (nullpermitted).
-
addSubtask
Adds a sub-task to the task.- Parameters:
subtask- the subtask.
-
removeSubtask
Removes a sub-task from the task.- Parameters:
subtask- the subtask.
-
getSubtaskCount
public int getSubtaskCount()Returns the sub-task count.- Returns:
- The sub-task count.
-
getSubtask
Returns a sub-task.- Parameters:
index- the index.- Returns:
- The sub-task.
-