com.prozima.pengine
Class Activity

java.lang.Object
  extended by com.prozima.pengine.ScheduleNode
      extended by com.prozima.pengine.Activity
All Implemented Interfaces:
java.lang.Cloneable

public class Activity
extends ScheduleNode

Represents the state of an activity, which is one of the two types of schedule node. An activity has a effort associated with it, which is the total amount of work which must be performed to complete the activity. One or more resources are assigned to the activity to perform the work.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.prozima.pengine.ScheduleNode
ScheduleNode.PredecessorType, ScheduleNode.Scheduling
 
Constructor Summary
Activity()
          Construct an Activity but do not initialise its state.
Activity(java.lang.Integer inProjectID, java.lang.Integer inScheduleID, java.lang.Integer inActivityID)
          Constructs an Activity and initialises its state.
Activity(java.lang.Integer inProjectID, java.lang.Integer inScheduleID, java.lang.Integer inActivityID, java.lang.Integer inAncestorID)
          Constructs an Activity and initialises its state.
 
Method Summary
 boolean addResourceID(int inResourceID)
          Assign a Resource to this Activity.
 Activity clone()
           
 java.util.Set<java.lang.Integer> getAllResourceIDs()
          Get set of the IDs of Resources assigned to this Activity.
 int getEffort()
          Retrieve the total effort required for this activity.
 boolean removeResourceID(int inResourceID)
          Remove a previously assigned Resource from this Activity.
 boolean setEffort(int inEffort)
          Set the effort required to complete this activity.
 
Methods inherited from class com.prozima.pengine.ScheduleNode
addRelationship, getAncestorID, getConstraint, getCumulativeEffort, getCumulativeEffortWorked, getID, getName, getProjectID, getRelationships, getScheduleID, getSchedulingPref, removeRelationship, setAncestorID, setConstraint, setID, setName, setProjectID, setScheduleID, setSchedulingPref, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Activity

public Activity()
Construct an Activity but do not initialise its state.


Activity

public Activity(java.lang.Integer inProjectID,
                java.lang.Integer inScheduleID,
                java.lang.Integer inActivityID)
Constructs an Activity and initialises its state. Activity is assumed to have no ancestor activity.

Parameters:
inProjectID - ID of parent project. Cannot be null.
inScheduleID - ID of parent schedule. Cannot be null.
inActivityID - ID which is assigned to this activity. Cannot be null.

Activity

public Activity(java.lang.Integer inProjectID,
                java.lang.Integer inScheduleID,
                java.lang.Integer inActivityID,
                java.lang.Integer inAncestorID)
Constructs an Activity and initialises its state. Activity is assigned an ancestor activity which it remains linked to.

Parameters:
inProjectID - ID of parent project. Cannot be null.
inScheduleID - ID of parent schedule. Cannot be null.
inActivityID - ID assigned to the activity. Cannot be null.
inAncestorID - ID of the ancestor activity. May be null if the Activity has no ancestor.
Method Detail

addResourceID

public boolean addResourceID(int inResourceID)
Assign a Resource to this Activity.

Parameters:
inResourceID - A valid Resource ID.
Returns:
true if the assigned Resource ID was valid, otherwise false. TODO Does not check if the ID of the Resource is valid.

clone

public Activity clone()
               throws java.lang.CloneNotSupportedException
Overrides:
clone in class ScheduleNode
Throws:
java.lang.CloneNotSupportedException

getAllResourceIDs

public java.util.Set<java.lang.Integer> getAllResourceIDs()
Get set of the IDs of Resources assigned to this Activity.

Returns:
Set of Resource IDs.

getEffort

public int getEffort()
Retrieve the total effort required for this activity.

Returns:
Effort in [minutes]

removeResourceID

public boolean removeResourceID(int inResourceID)
Remove a previously assigned Resource from this Activity.

Parameters:
inResourceID - Previously assigned Resource ID.
Returns:
true if the Resource was assigned to this Activity and can be removed, otherwise false.

setEffort

public boolean setEffort(int inEffort)
Set the effort required to complete this activity.

Parameters:
inEffort - Value in [Minutes]. Must be greater than or equal to zero.
Returns:
true if effort is greater than or equal to zero, otherwise false.