org.jfree.data.gantt

Class Task

public class Task extends Object implements Cloneable, PublicCloneable, Serializable

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(String description, TimePeriod duration)
Creates a new task.
Task(String description, Date start, Date end)
Creates a new task.
Method Summary
voidaddSubtask(Task subtask)
Adds a sub-task to the task.
Objectclone()
Returns a clone of the task.
booleanequals(Object object)
Tests this object for equality with an arbitrary object.
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 Detail

Task

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

Parameters: description the task description (null not permitted). duration the task duration (null permitted).

Task

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

Parameters: description the task description (null not permitted). start the start date (null not permitted). end the end date (null not permitted).

Method Detail

addSubtask

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

Parameters: subtask the subtask (null not permitted).

clone

public Object clone()
Returns a clone of the task.

Returns: A clone.

Throws: CloneNotSupportedException never thrown by this class, but subclasses may not support cloning.

equals

public boolean equals(Object object)
Tests this object for equality with an arbitrary object.

Parameters: object the other object (null permitted).

Returns: A boolean.

getDescription

public String getDescription()
Returns the task description.

Returns: The task description (never null).

getDuration

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

Returns: The task duration (possibly null).

getPercentComplete

public Double getPercentComplete()
Returns the percentage complete for this task.

Returns: The percentage complete (possibly null).

getSubtask

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

Parameters: index the index.

Returns: The sub-task.

getSubtaskCount

public int getSubtaskCount()
Returns the sub-task count.

Returns: The sub-task count.

removeSubtask

public void removeSubtask(Task subtask)
Removes a sub-task from the task.

Parameters: subtask the subtask.

setDescription

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

Parameters: description the description (null not permitted).

setDuration

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

Parameters: duration the duration (null permitted).

setPercentComplete

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

Parameters: percent the percentage (null permitted).

setPercentComplete

public void setPercentComplete(double percent)
Sets the percentage complete for the task.

Parameters: percent the percentage.