com.prozima.pengine
Class Work

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

public class Work
extends java.lang.Object
implements java.lang.Cloneable

Represents the effort which was or will be expended by a resource towards the completion of an activity. Each unit of work is associated with a single activity and a single resource.


Field Summary
static java.util.Comparator<Work> START_DATE_COMPARATOR
          Sort Work objects by their start date.
 
Constructor Summary
Work()
           
 
Method Summary
 Work clone()
           
 java.lang.Integer getActivityID()
          Retrieve the ID of the associated activity.
 int getEffort()
          Get the effort that was/will be contributed by this Work.
 java.lang.Integer getProjectID()
          Retrieve the ID of the parent project.
 java.lang.Integer getResourceID()
          Retrieve the ID of the parent resource.
 java.util.Date getStartDate()
          Retrieve the date and time the Work did/will start at.
 boolean setActivityID(int inID)
          Store the ID of the parent activity.
 boolean setEffort(int inEffort)
          Set the effort which the Work will contribute towards an activity.
 boolean setProjectID(int inID)
          Store the ID of the parent Project.
 boolean setResourceID(int inID)
          Store the ID of the parent resource.
 boolean setStartDate(java.util.Date inDate)
          Set the date and time at which the work starts.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_DATE_COMPARATOR

public static final java.util.Comparator<Work> START_DATE_COMPARATOR
Sort Work objects by their start date.

Constructor Detail

Work

public Work()
Method Detail

clone

public Work clone()
           throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getActivityID

public java.lang.Integer getActivityID()
Retrieve the ID of the associated activity.

Returns:
ID of an activity or null if not set.

getEffort

public int getEffort()
Get the effort that was/will be contributed by this Work.

Returns:
Effort in minutes.

getProjectID

public java.lang.Integer getProjectID()
Retrieve the ID of the parent project.

Returns:
ID of a Project or null if not set.

getResourceID

public java.lang.Integer getResourceID()
Retrieve the ID of the parent resource.

Returns:
ID of the resource or null if not set.

getStartDate

public java.util.Date getStartDate()
Retrieve the date and time the Work did/will start at.

Returns:
Date or null if it hasn't been set.

setActivityID

public boolean setActivityID(int inID)
Store the ID of the parent activity.

Returns:
true if new ID was valid, otherwise false.

setEffort

public boolean setEffort(int inEffort)
Set the effort which the Work will contribute towards an activity.

Parameters:
inEffort - Effort in minutes.
Returns:
true if the effort value is not negative.

setProjectID

public boolean setProjectID(int inID)
Store the ID of the parent Project.

Returns:
true if new ID was valid, otherwise false.

setResourceID

public boolean setResourceID(int inID)
Store the ID of the parent resource.

Returns:
true if new ID was valid, otherwise false.

setStartDate

public boolean setStartDate(java.util.Date inDate)
Set the date and time at which the work starts. Work was/is performed on the activity from this point in time for a specific duration.

Parameters:
inDate - Starting date and time of the Work.
Returns:
true if the Date object is correct, otherwise false;
See Also:
setEffort(int)