watch
Class Task

java.lang.Object
  extended by watch.Commentable
      extended by watch.Task

 class Task
extends Commentable

Task model class.


Field Summary
static int SCHEDULING_AT_END
          "At-end" scheduling.
static int SCHEDULING_LINEAR
          Linear scheduling.
static int SCHEDULING_NONE
          No scheduling.
 
Constructor Summary
Task(java.lang.String J_TaskId, Date W_ReferenceStartDate, double D_Reference, double D_ReferenceRisks, double D_ReferenceOpportunities, Date W_PlannedStartDate, Date W_PlannedEndDate, int E_SchedulingMode)
          Constructor.
 
Method Summary
 void addImputation(Imputation W_Imputation)
          Imputation addition.
 void addRevision(Revision W_Revision)
          Revision addition.
 void addSubTask(Task W_Task)
          Sub-task addition.
 void compute(User.Map W_Users, Date W_ReferenceDate, Date W_StartDate, Date W_EndDate, java.lang.String J_TraceOffset)
          Recursive computation method.
 Task findTask(java.lang.String J_TaskId)
          Task or sub-task research.
 Computation getComputation(Date W_UpTo, boolean B_Cumulative)
          Get the (cumulative) computation of the task up to a given date.
 Date getComputedEndDate()
          Computed end date accessor.
 Date getComputedStartDate()
          Computed start date accessor.
 java.lang.String getId()
          Identifier accessor.
 Computation getLastComputation()
          Last computation accessor.
 Date getLockEndDate()
          Lock end date accessor.
 Task getParent()
          Parent task accessor.
 Date getPlannedEndDate()
          Planned end date accessor.
 Date getPlannedStartDate()
          Planned start date accessor.
 double getReference()
          Reference value accessor.
 double getReferenceOpportunities()
          Reference opportunities value accessor.
 double getReferenceRisks()
          Reference risks value accessor.
 Date getReferenceStartDate()
          Reference start date accessor.
 int getSchedulingMode()
          Scheduling mode accessor.
 java.util.Iterator<Task> getSubTaskIterator()
          Sub-tasks iterator accessor.
 boolean isFinal()
          Final characteristic accessor.
 boolean isLocked()
          Lock attribute accessor.
 void lock(Date W_LockDate)
          Lock operation.
 Computation mkXmlResult(org.w3c.dom.Element W_ParentNode, boolean B_SumImputationsOnly)
          Create the XML computation result.
 void setParent(Task W_Parent)
          Task/sub-task relation management.
 java.lang.String toString()
          String representation of the task.
 
Methods inherited from class watch.Commentable
getComments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SCHEDULING_NONE

public static final int SCHEDULING_NONE
No scheduling. The BCWS of the task itself will not be computed. Does not prevent BCWS computing for the sub-tasks.

See Also:
Constant Field Values

SCHEDULING_AT_END

public static final int SCHEDULING_AT_END
"At-end" scheduling. The BCWS of the task will be considered to be done at the end date only. Fits for development tasks of 15-20 days or less, which advancement is 0% until it is fully completed (100%).

See Also:
Constant Field Values

SCHEDULING_LINEAR

public static final int SCHEDULING_LINEAR
Linear scheduling. The BCWS of the task will be approximated linearly from the planned starting date to the planned ending date of the task.

See Also:
Constant Field Values
Constructor Detail

Task

public Task(java.lang.String J_TaskId,
            Date W_ReferenceStartDate,
            double D_Reference,
            double D_ReferenceRisks,
            double D_ReferenceOpportunities,
            Date W_PlannedStartDate,
            Date W_PlannedEndDate,
            int E_SchedulingMode)
Constructor.

Parameters:
J_TaskId - Identifier of the task.
D_Reference - Reference value of the task. If negative, the task should not be checked against this value.
D_ReferenceRisks - Reference risks value of the task.
D_ReferenceOpportunities - Reference opportunities value of the task.
W_ReferenceStartDate - Reference starting date of the task. Can be null. If set, the reference value takes effect from this start date only. If set, imputations and revisions cannot be applied before that date neither.
W_PlannedStartDate - Planned starting date of the task. Can be null. Useful with W_PlannedEndDate for BCWS computation.
W_PlannedEndDate - Planned ending date of the task. Can be null. Useful with W_PlannedStartDate for BCWS computation.
E_SchedulingMode - Scheduling mode. Either SCHEDULING_NONE, SCHEDULING_AT_END or SCHEDULING_LINEAR.
Method Detail

getId

public java.lang.String getId()
Identifier accessor.

Returns:
The identifier of the task.

toString

public java.lang.String toString()
String representation of the task.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of the task.

getReference

public double getReference()
Reference value accessor.

Returns:
The reference value of the task.

getReferenceRisks

public double getReferenceRisks()
Reference risks value accessor.

Returns:
The reference risks value of the task.

getReferenceOpportunities

public double getReferenceOpportunities()
Reference opportunities value accessor.

Returns:
The reference opportunities value of the task.

setParent

public void setParent(Task W_Parent)
Task/sub-task relation management. Permits the parent task positionning. When the start date of the task is not set, and the parent task has a start date set, the sub-task automatically inherits from this start date.

Parameters:
W_Parent - Parent task reference.

getParent

public Task getParent()
Parent task accessor.

Returns:
The parent task reference.

isFinal

public boolean isFinal()
Final characteristic accessor. Determines whether this task is final, ie it has no sub-task.

Returns:
true for final task, false otherwise.

getSubTaskIterator

public java.util.Iterator<Task> getSubTaskIterator()
Sub-tasks iterator accessor.

Returns:
An iterator over the sub-tasks.

addSubTask

public void addSubTask(Task W_Task)
Sub-task addition.

Parameters:
W_Task - Sub-task added.

findTask

public Task findTask(java.lang.String J_TaskId)
Task or sub-task research. Recursive search: looks in directs and deeper sub-tasks for the identifier researched. The research may also return the task itself if convenient.

Parameters:
J_TaskId - Identifier of the task researched.

addImputation

public void addImputation(Imputation W_Imputation)
Imputation addition. The imputations are stored in a collection member object, keeping them ready for later computations.

Parameters:
W_Imputation - Imputation added.

addRevision

public void addRevision(Revision W_Revision)
Revision addition. The revisions are stored in a collection member object, keeping them ready for later computations.

Parameters:
W_Revision - Revision added.

isLocked

public boolean isLocked()
Lock attribute accessor.

Returns:
true when the task is locked, false otherwise.

lock

public void lock(Date W_LockDate)
Lock operation. Sets the lock date for the task. Imputations and revisions after this date are then forbidden. This lock operation scans the imputations and revisions already attached to the task, and possibly makes corrections in coherence whith that principle.

Parameters:
W_LockDate - Lock date.

compute

public void compute(User.Map W_Users,
                    Date W_ReferenceDate,
                    Date W_StartDate,
                    Date W_EndDate,
                    java.lang.String J_TraceOffset)
Recursive computation method. The computation is disptached recursively on the tasks and sub-tasks. This recursive method is the one allowing such computation.

Parameters:
W_Users - List of users to focus the computation onto.
W_ReferenceDate - Reference date for the computation.
W_StartDate - Start date of the computation.
W_EndDate - End date of the computation.
J_TraceOffset - Useful for recursion debugging only.
See Also:
Watch.execute(java.lang.String, java.util.Collection, java.lang.String, java.lang.String, java.lang.String, boolean, boolean, watch.Transformation, java.lang.String)

getLastComputation

public Computation getLastComputation()
Last computation accessor. Retrieves the last computation object after a computation launched previously.

Returns:
The last computation.
See Also:
compute(watch.User.Map, watch.Date, watch.Date, watch.Date, java.lang.String)

getComputation

public Computation getComputation(Date W_UpTo,
                                  boolean B_Cumulative)
Get the (cumulative) computation of the task up to a given date.

Parameters:
W_UpTo - Computation up to a given date.
B_Cumulative - Cumulative computation or not over the sub-tasks.
Returns:
The computation.

getReferenceStartDate

public Date getReferenceStartDate()
Reference start date accessor.

Returns:
The reference start date. null if no reference start date is set for the task.

getPlannedStartDate

public Date getPlannedStartDate()
Planned start date accessor.

Returns:
The planned start date. null if no planned start date is set for the task.

getPlannedEndDate

public Date getPlannedEndDate()
Planned end date accessor.

Returns:
The planned end date. null if no planned end date is set for the task.

getSchedulingMode

public int getSchedulingMode()
Scheduling mode accessor.

Returns:
SCHEDULING_NONE if not applicable, the configured scheduling mode otherwise.

getComputedStartDate

public Date getComputedStartDate()
Computed start date accessor.

Returns:
The computed start date. null if no start date has been computed.

getComputedEndDate

public Date getComputedEndDate()
Computed end date accessor.

Returns:
The compted end date. null if no end date has been computed.

getLockEndDate

public Date getLockEndDate()
Lock end date accessor.

Returns:
The lock end date. null if the task is not locked.

mkXmlResult

public Computation mkXmlResult(org.w3c.dom.Element W_ParentNode,
                               boolean B_SumImputationsOnly)
Create the XML computation result.

Parameters:
W_ParentNode - Parent node to place the task computation result into. Either the root XML node, or the parent task XML result node.
B_SumImputationsOnly - When true, limits the XML result at the sum of imputations.
Returns:
A computation object representing the final status of the task.