All Packages Class Hierarchy This Package Previous Next Index
Class designer.Task
java.lang.Object
|
+----designer.Task
- public class Task
- extends Object
- implements PlanItem
A Task object encapsulates a series of steps that are performed in the
execution of a plan within the Design Problem Solver.
-
Task()
-
Default construtor
-
Task(String)
-
Construtor with name
returns an instance of this class with the _name set to name.
-
addStep(Step)
- Adds a step to the end of the stepList vector
PRE: stepToAdd is an Object that implements Step interface.
-
execute()
- Execute each step in StepList in order
-
getName()
-
-
getStepAt(int)
-
PRE: index < stepList.length
-
getStepNames()
-
-
insertStepAt(Step, int)
- Insert a step at the given index in stepList.
-
removeStep(String)
- remove a step from stepList by its name
removes the first step with this name if more than one step has same name.
-
removeStepAt(int)
- remove a step from stepList by its index
PRE: 0 <= index < stepList.length
POST: stepList does not include step previously at index .
-
setName(String)
- sets the name parameter of this object to the String input.
Task
public Task()
- Default construtor
Task
public Task(String name)
- Construtor with name
returns an instance of this class with the _name set to name.
setName
public void setName(String name)
- sets the name parameter of this object to the String input.
getName
public String getName()
- Returns:
- the name string of this instance of this class.
getStepNames
public String[] getStepNames()
- Returns:
- an array of Strings corresponding to the names of a steps in this
task.
addStep
public boolean addStep(Step stepToAdd)
- Adds a step to the end of the stepList vector
PRE: stepToAdd is an Object that implements Step interface.
POST: stepToAdd is last element of stepList.
- Parameters:
- stepToAdd - the object implementing Step Interface to add to stepList
- Returns:
- true if successful false if failed.
insertStepAt
public boolean insertStepAt(Step stepToInsert,
int index)
- Insert a step at the given index in stepList. Move previous steps in
stepList up one index.
PRE: prevStep is element of stepList.
POST: stepToInsert in StepList after prevStep.
- Parameters:
- stepToInsert - the object implementing Step Interface to add to stepList
- index - at which to insert stepToInsert
- Returns:
- true if successful false if failed.
removeStep
public boolean removeStep(String stepToRemoveName)
- remove a step from stepList by its name
removes the first step with this name if more than one step has same name.
PRE: stepToRemoveName matchs name of an object in stepList
POST: stepList does not include step with name stepToRemoveName
- Parameters:
- stepToRemove - object in stepList to be removed.
- Returns:
- true if successful false if failed.
removeStepAt
public boolean removeStepAt(int index)
- remove a step from stepList by its index
PRE: 0 <= index < stepList.length
POST: stepList does not include step previously at index .
- Parameters:
- stepToRemove - object in stepList to be removed.
- Returns:
- true if successful false if failed.
getStepAt
public Step getStepAt(int index)
-
PRE: index < stepList.length
- Parameters:
- index - into the step list.
- Returns:
- a reference to the Step object at the given index of stepList
execute
public boolean execute()
- Execute each step in StepList in order
- Returns:
- true if successful false if failed.
All Packages Class Hierarchy This Package Previous Next Index