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.


Constructor Index

 o Task()
Default construtor
 o Task(String)
Construtor with name returns an instance of this class with the _name set to name.

Method Index

 o addStep(Step)
Adds a step to the end of the stepList vector
PRE: stepToAdd is an Object that implements Step interface.
 o execute()
Execute each step in StepList in order
 o getName()
 o getStepAt(int)

PRE: index < stepList.length
 o getStepNames()
 o insertStepAt(Step, int)
Insert a step at the given index in stepList.
 o 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.
 o removeStepAt(int)
remove a step from stepList by its index
PRE: 0 <= index < stepList.length
POST: stepList does not include step previously at index .
 o setName(String)
sets the name parameter of this object to the String input.

Constructors

 o Task
 public Task()
Default construtor

 o Task
 public Task(String name)
Construtor with name returns an instance of this class with the _name set to name.

Methods

 o setName
 public void setName(String name)
sets the name parameter of this object to the String input.

 o getName
 public String getName()
Returns:
the name string of this instance of this class.
 o getStepNames
 public String[] getStepNames()
Returns:
an array of Strings corresponding to the names of a steps in this task.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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
 o 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