com.prozima.pengine
Class AddWorkCommand

java.lang.Object
  extended by com.prozima.pengine.AddWorkCommand
All Implemented Interfaces:
Command

public class AddWorkCommand
extends java.lang.Object
implements Command

Command which adds work which contributes towards an activity. Work is performed by a resource and reduces the effort remaining for the activity. Command distinguishes between work which is "new" and work which comes from persistent storage. New work usually results from a user or the resource reporting that they have contributed work towards an activity. This work will be associated with the activity and the remaining scheduled work for the activity will be decremented. Work which is not "new", is interpreted as work which was performed previously and has already been decremented from the scheduled work for the activity. This is usually the case when initialising the state of the PEngine library.

See Also:
Activity, Resource, Work

Constructor Summary
AddWorkCommand(Work inWork, boolean inIsNew)
          Create the command and initialise its state.
 
Method Summary
 Work getWork()
          Get a description of the Work.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddWorkCommand

public AddWorkCommand(Work inWork,
                      boolean inIsNew)
Create the command and initialise its state.

Parameters:
inWork - Description of the Work to be created. null should never be passed as value.
inIsNew - true if the work is being logged for the first time. New work will replace previously scheduled work for an activity. false if the work was logged previously and is now being restored from persistent storage. Work which is not new will not replace previously scheduled work.
Method Detail

getWork

public Work getWork()
Get a description of the Work.

Returns:
Work. null should never be returned.