MPXJ: Microsoft Project Exchange

net.sf.mpxj
Class ResourceAssignment

Package class diagram package ResourceAssignment
java.lang.Object
  extended by net.sf.mpxj.ProjectEntity
      extended by net.sf.mpxj.ResourceAssignment

public final class ResourceAssignment
extends ProjectEntity

This class represents a resource assignment record from an MPX file.


Field Summary
static java.lang.Double DEFAULT_UNITS
          Default units value: 100%.
 
Constructor Summary
ResourceAssignment(ProjectFile file, Task task)
          Default constructor.
 
Method Summary
 ResourceAssignmentWorkgroupFields addWorkgroupAssignment()
          This method allows a resource assignment workgroup fields record to be added to the current resource assignment.
 java.lang.Number getActualCost()
          Returns the actual cost for this resource assignment.
 Duration getActualWork()
          Returns the actual completed work of this resource assignment.
 ProjectCalendar getCalendar()
          Retrieves the calendar used for this resource assignment.
 java.lang.Number getCost()
          Returns the cost of this resource assignment.
 Duration getDelay()
          Returns the delay for this resource assignment.
 java.util.Date getFinish()
          Returns the finish date for this resource assignment.
 boolean getHasTimephasedData()
          Retrieve a flag indicating if this resource assignment has timephased data associated with it.
 Duration getOvertimeWork()
          Returns the overtime work done of this resource assignment.
 java.lang.Number getPlannedCost()
          Returns the planned cost for this resource assignment.
 Duration getPlannedWork()
          Returns the planned work of this resource assignment.
 Duration getRemainingWork()
          Returns the remaining work for this resource assignment.
 Resource getResource()
          This method retrieves a reference to the resource with which this assignment is associated.
 java.lang.Integer getResourceUniqueID()
          Returns the resources unique id for this resource assignment.
 java.util.Date getStart()
          Returns the start of this resource assignment.
 Task getTask()
          This method retrieves a reference to the task with which this assignment is associated.
 java.util.List<TimephasedResourceAssignment> getTimephasedComplete()
          Retrieves the timephased breakdown of the completed work for this resource assignment.
 java.util.List<TimephasedResourceAssignment> getTimephasedPlanned()
          Retrieves the timephased breakdown of the planned work for this resource assignment.
 java.lang.Number getUnits()
          Returns the units of this resource assignment.
 Duration getWork()
          Returns the work of this resource assignment.
 WorkContour getWorkContour()
          This method returns the Work Contour type of this Assignment.
 ResourceAssignmentWorkgroupFields getWorkgroupAssignment()
          Gets the Resource Assignment Workgroup Fields if one exists.
 void remove()
          Removes this resource assignment from the project.
 void setActualCost(java.lang.Number val)
          Sets the actual cost so far incurred for this resource assignment.
 void setActualWork(Duration dur)
          Sets the actual completed work for this resource assignment.
 void setCost(java.lang.Number val)
          Sets the cost for this resource assignment.
 void setDelay(Duration dur)
          Sets the delay for this resource assignment.
 void setFinish(java.util.Date val)
          Sets the finish date for this resource assignment.
 void setOvertimeWork(Duration dur)
          Sets the overtime work for this resource assignment.
 void setPlannedCost(java.lang.Number val)
          Sets the planned cost for this resource assignment.
 void setPlannedWork(Duration dur)
          Sets the planned work for this resource assignment.
 void setRemainingWork(Duration remainingWork)
          Sets the remaining work for this resource assignment.
 void setResourceUniqueID(java.lang.Integer val)
          Sets the resources unique id for this resource assignment.
 void setStart(java.util.Date val)
          Sets the start date for this resource assignment.
 void setTimephasedComplete(java.util.List<TimephasedResourceAssignment> timephasedComplete, boolean raw)
          Sets the timephased breakdown of the completed work for this resource assignment.
 void setTimephasedNormaliser(TimephasedResourceAssignmentNormaliser normaliser)
          Set the class instance used to normalise timephased data.
 void setTimephasedPlanned(java.util.List<TimephasedResourceAssignment> timephasedPlanned, boolean raw)
          Sets the timephased breakdown of the planned work for this resource assignment.
 void setUnits(java.lang.Number val)
          Sets the units for this resource assignment.
 void setWork(Duration dur)
          Sets the work for this resource assignment.
 void setWorkContour(WorkContour workContour)
          This method sets the Work Contour type of this Assignment.
 java.lang.String toString()
          
 
Methods inherited from class net.sf.mpxj.ProjectEntity
getParentFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_UNITS

public static final java.lang.Double DEFAULT_UNITS
Default units value: 100%.

Constructor Detail

ResourceAssignment

ResourceAssignment(ProjectFile file,
                   Task task)
Default constructor.

Parameters:
file - The parent file to which this record belongs.
task - The task to which this assignment is being made
Method Detail

addWorkgroupAssignment

public ResourceAssignmentWorkgroupFields addWorkgroupAssignment()
                                                         throws MPXJException
This method allows a resource assignment workgroup fields record to be added to the current resource assignment. A maximum of one of these records can be added to a resource assignment record.

Returns:
ResourceAssignmentWorkgroupFields object
Throws:
MPXJException - if MSP defined limit of 1 is exceeded

getUnits

public java.lang.Number getUnits()
Returns the units of this resource assignment.

Returns:
units

setUnits

public void setUnits(java.lang.Number val)
Sets the units for this resource assignment.

Parameters:
val - units

getWork

public Duration getWork()
Returns the work of this resource assignment.

Returns:
work

setWork

public void setWork(Duration dur)
Sets the work for this resource assignment.

Parameters:
dur - work

getPlannedWork

public Duration getPlannedWork()
Returns the planned work of this resource assignment.

Returns:
planned work

setPlannedWork

public void setPlannedWork(Duration dur)
Sets the planned work for this resource assignment.

Parameters:
dur - planned work

getActualWork

public Duration getActualWork()
Returns the actual completed work of this resource assignment.

Returns:
completed work

setActualWork

public void setActualWork(Duration dur)
Sets the actual completed work for this resource assignment.

Parameters:
dur - actual completed work

getOvertimeWork

public Duration getOvertimeWork()
Returns the overtime work done of this resource assignment.

Returns:
overtime work

setOvertimeWork

public void setOvertimeWork(Duration dur)
Sets the overtime work for this resource assignment.

Parameters:
dur - overtime work

getCost

public java.lang.Number getCost()
Returns the cost of this resource assignment.

Returns:
cost

setCost

public void setCost(java.lang.Number val)
Sets the cost for this resource assignment.

Parameters:
val - cost

getPlannedCost

public java.lang.Number getPlannedCost()
Returns the planned cost for this resource assignment.

Returns:
planned cost

setPlannedCost

public void setPlannedCost(java.lang.Number val)
Sets the planned cost for this resource assignment.

Parameters:
val - planned cost

getActualCost

public java.lang.Number getActualCost()
Returns the actual cost for this resource assignment.

Returns:
actual cost

setActualCost

public void setActualCost(java.lang.Number val)
Sets the actual cost so far incurred for this resource assignment.

Parameters:
val - actual cost

getStart

public java.util.Date getStart()
Returns the start of this resource assignment.

Returns:
start date

setStart

public void setStart(java.util.Date val)
Sets the start date for this resource assignment.

Parameters:
val - start date

getFinish

public java.util.Date getFinish()
Returns the finish date for this resource assignment.

Returns:
finish date

setFinish

public void setFinish(java.util.Date val)
Sets the finish date for this resource assignment.

Parameters:
val - finish date

getDelay

public Duration getDelay()
Returns the delay for this resource assignment.

Returns:
delay

setDelay

public void setDelay(Duration dur)
Sets the delay for this resource assignment.

Parameters:
dur - delay

getResourceUniqueID

public java.lang.Integer getResourceUniqueID()
Returns the resources unique id for this resource assignment.

Returns:
resources unique id

setResourceUniqueID

public void setResourceUniqueID(java.lang.Integer val)
Sets the resources unique id for this resource assignment.

Parameters:
val - resources unique id

getWorkgroupAssignment

public ResourceAssignmentWorkgroupFields getWorkgroupAssignment()
Gets the Resource Assignment Workgroup Fields if one exists.

Returns:
workgroup assignment object

getTask

public Task getTask()
This method retrieves a reference to the task with which this assignment is associated.

Returns:
task

getResource

public Resource getResource()
This method retrieves a reference to the resource with which this assignment is associated.

Returns:
resource

getWorkContour

public WorkContour getWorkContour()
This method returns the Work Contour type of this Assignment.

Returns:
the Work Contour type

setWorkContour

public void setWorkContour(WorkContour workContour)
This method sets the Work Contour type of this Assignment.

Parameters:
workContour - the Work Contour type

remove

public void remove()
Removes this resource assignment from the project.


getRemainingWork

public Duration getRemainingWork()
Returns the remaining work for this resource assignment.

Returns:
remaining work

setRemainingWork

public void setRemainingWork(Duration remainingWork)
Sets the remaining work for this resource assignment.

Parameters:
remainingWork - remaining work

getTimephasedComplete

public java.util.List<TimephasedResourceAssignment> getTimephasedComplete()
Retrieves the timephased breakdown of the completed work for this resource assignment.

Returns:
timephased completed work

setTimephasedComplete

public void setTimephasedComplete(java.util.List<TimephasedResourceAssignment> timephasedComplete,
                                  boolean raw)
Sets the timephased breakdown of the completed work for this resource assignment.

Parameters:
timephasedComplete - timephased completed work
raw - flag indicating if the assignment data is raw

getTimephasedPlanned

public java.util.List<TimephasedResourceAssignment> getTimephasedPlanned()
Retrieves the timephased breakdown of the planned work for this resource assignment.

Returns:
timephased planned work

setTimephasedPlanned

public void setTimephasedPlanned(java.util.List<TimephasedResourceAssignment> timephasedPlanned,
                                 boolean raw)
Sets the timephased breakdown of the planned work for this resource assignment.

Parameters:
timephasedPlanned - timephased planned work
raw - flag indicating if the assignment data is raw

setTimephasedNormaliser

public void setTimephasedNormaliser(TimephasedResourceAssignmentNormaliser normaliser)
Set the class instance used to normalise timephased data.

Parameters:
normaliser - class instance used to normalise timephased data

getHasTimephasedData

public boolean getHasTimephasedData()
Retrieve a flag indicating if this resource assignment has timephased data associated with it.

Returns:
true if this resource assignment has timephased data

getCalendar

public ProjectCalendar getCalendar()
Retrieves the calendar used for this resource assignment.

Returns:
ProjectCalendar instance

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2000-2009 Packwood Software. All Rights Reserved.