org.jfree.data.gantt
Class Task

java.lang.Object
  extended byorg.jfree.data.gantt.Task

public class Task
extends java.lang.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
Task(java.lang.String description, java.util.Date start, java.util.Date end)
          Creates a new task.
Task(java.lang.String description, TimePeriod duration)
          Creates a new task.
 
Method Summary
 void addSubtask(Task subtask)
          Adds a sub-task to the task.
 java.lang.String getDescription()
          Returns the task description.
 TimePeriod getDuration()
          Returns the duration (actual or estimated) of the task.
 java.lang.Double getPercentComplete()
          Returns the percentage complete for this task.
 Task getSubtask(int index)
          Returns a sub-task.
 int getSubtaskCount()
          Returns the sub-task count.
 void removeSubtask(Task subtask)
          Removes a sub-task from the task.
 void setDescription(java.lang.String description)
          Sets the task description.
 void setDuration(TimePeriod duration)
          Sets the task duration (actual or estimated).
 void setPercentComplete(double percent)
          Sets the percentage complete for the task.
 void setPercentComplete(java.lang.Double percent)
          Sets the percentage complete for the task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Task

public Task(java.lang.String description,
            TimePeriod duration)
Creates a new task.

Parameters:
description - the task description.
duration - the task duration.

Task

public Task(java.lang.String description,
            java.util.Date start,
            java.util.Date end)
Creates a new task.

Parameters:
description - the task description.
start - the start date.
end - the end date.
Method Detail

getDescription

public java.lang.String getDescription()
Returns the task description.

Returns:
The task description.

setDescription

public void setDescription(java.lang.String description)
Sets the task description.

Parameters:
description - the new description.

getDuration

public TimePeriod getDuration()
Returns the duration (actual or estimated) of the task.

Returns:
The task duration.

setDuration

public void setDuration(TimePeriod duration)
Sets the task duration (actual or estimated).

Parameters:
duration - the duration.

getPercentComplete

public java.lang.Double 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

public void setPercentComplete(java.lang.Double percent)
Sets the percentage complete for the task.

Parameters:
percent - the percentage (null permitted).

addSubtask

public void addSubtask(Task subtask)
Adds a sub-task to the task.

Parameters:
subtask - the subtask.

removeSubtask

public void removeSubtask(Task subtask)
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

public Task getSubtask(int index)
Returns a sub-task.

Parameters:
index - the index.
Returns:
The sub-task.