Package org.jfree.data.gantt
Class Task
- java.lang.Object
-
- org.jfree.data.gantt.Task
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,PublicCloneable
public class Task extends java.lang.Object implements java.lang.Cloneable, PublicCloneable, java.io.Serializable
A simple representation of a task. The task has a description and a duration. You can add sub-tasks to the task.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringdescriptionThe task description.private TimePerioddurationThe time period for the task (estimated or actual).private java.lang.DoublepercentCompleteThe percent complete (nullis permitted).private static longserialVersionUIDFor serialization.private java.util.ListsubtasksStorage for the sub-tasks (if any).
-
Constructor Summary
Constructors Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSubtask(Task subtask)Adds a sub-task to the task.booleancanEqual(java.lang.Object other)Ensures symmetry between super/subclass implementations of equals.java.lang.Objectclone()Returns a clone of the task.booleanequals(java.lang.Object object)Tests this object for equality with an arbitrary object.java.lang.StringgetDescription()Returns the task description.TimePeriodgetDuration()Returns the duration (actual or estimated) of the task.java.lang.DoublegetPercentComplete()Returns the percentage complete for this task.TaskgetSubtask(int index)Returns a sub-task.intgetSubtaskCount()Returns the sub-task count.inthashCode()voidremoveSubtask(Task subtask)Removes a sub-task from the task.voidsetDescription(java.lang.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(java.lang.Double percent)Sets the percentage complete for the task.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
description
private java.lang.String description
The task description.
-
duration
private TimePeriod duration
The time period for the task (estimated or actual).
-
percentComplete
private java.lang.Double percentComplete
The percent complete (nullis permitted).
-
subtasks
private java.util.List subtasks
Storage for the sub-tasks (if any).
-
-
Constructor Detail
-
Task
public Task(java.lang.String description, TimePeriod duration)Creates a new task.- Parameters:
description- the task description (nullnot permitted).duration- the task duration (nullpermitted).
-
Task
public Task(java.lang.String description, java.util.Date start, java.util.Date end)Creates a new task.- Parameters:
description- the task description (nullnot permitted).start- the start date (nullnot permitted).end- the end date (nullnot permitted).
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
Returns the task description.- Returns:
- The task description (never
null).
-
setDescription
public void setDescription(java.lang.String description)
Sets the task description.- Parameters:
description- the description (nullnot permitted).
-
getDuration
public TimePeriod getDuration()
Returns the duration (actual or estimated) of the task.- Returns:
- The task duration (possibly
null).
-
setDuration
public void setDuration(TimePeriod duration)
Sets the task duration (actual or estimated).- Parameters:
duration- the duration (nullpermitted).
-
getPercentComplete
public java.lang.Double getPercentComplete()
Returns the percentage complete for this task.- Returns:
- The percentage complete (possibly
null).
-
setPercentComplete
public void setPercentComplete(java.lang.Double percent)
Sets the percentage complete for the task.- Parameters:
percent- the percentage (nullpermitted).
-
setPercentComplete
public void setPercentComplete(double percent)
Sets the percentage complete for the task.- Parameters:
percent- the percentage.
-
addSubtask
public void addSubtask(Task subtask)
Adds a sub-task to the task.- Parameters:
subtask- the subtask (nullnot permitted).
-
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.
-
equals
public boolean equals(java.lang.Object object)
Tests this object for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
object- the other object (nullpermitted).- Returns:
- A boolean.
-
canEqual
public boolean canEqual(java.lang.Object other)
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance.- Parameters:
other- Object- Returns:
- true ONLY if the parameter is THIS class type
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of the task.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classjava.lang.Object- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- never thrown by this class, but subclasses may not support cloning.
-
-