All Packages Class Hierarchy This Package Previous Next Index
Class designer.Plan
java.lang.Object
|
+----designer.Plan
- public class Plan
- extends Object
- implements PlanItem
Base class of the Plans
-
Plan()
- Purpose: Default constructor
-
Plan(String)
- Purpose: Constructor
-
addConstraint(String)
- Purpose: Creates new Constaint
Pre: none
Post: Constraint created, added to end of vector
-
addItem(PlanItem)
- Purpose: Adds a new item to the plan list
Pre: duplicate name should not exist
Post: item added to planlist
-
addSpecialist(String)
- Purpose: Creates a new Specialist
Pre: none
Post: Specialist created, added to end of vector
-
addTask(String)
- Purpose: Creates a new Task and adds it to the end of the list
Pre: none
Post: Task created, added to end of vector
-
execute()
- Purpose: Executes all tasks, specialists and constraints in the list
Pre: none
Post: return true if all plan items executed correctly, else false
-
getItemAt(int)
- Purpose: Gets the individual plan items
Pre: index >= 0 && index < planList.size()
Post: rtnval == planItems
-
getName()
- Purpose: Gets the name of the Plan
Pre: none
Post: returns name of selector
-
getRank()
- Purpose: Runs the Sponsor to get the rank
Pre: none
Post: returns rank
-
getSponsor()
- Purpose: Gets the reference to the sponsor
Pre: none
POst: retval == Sponsor
-
insertItemAt(int, PlanItem)
- Purpose: inserts the object into the vector
Pre: index <= Vector.size() && (newPlanItem must be type Task, Specialist or Constraint
Post: newPlanItem inserted at index
-
removeItemAt(int)
- remove a planItem from planList by its index
PRE: 0 <= index < stepList.length
POST: stepList does not include step previously at index .
-
removePlanItem(String)
- remove a plan from the vector by its name
PRE: itemToRemoveName matchs name of an object in stepList
POST: vector does not include step with name itemToRemoveName
-
setPlanItemList(Vector)
- Purpose: Sets the plan list to an input vector of plan items
Pre: vector must contain all elements of PlanItem type
Post plan list set
-
setSponsor(Sponsor)
- Purpose: Sets the sponsor reference to a sponsor object
Pre: none
Post: sponsor reference set
Plan
public Plan(String name)
- Purpose: Constructor
Plan
public Plan()
- Purpose: Default constructor
execute
public boolean execute()
- Purpose: Executes all tasks, specialists and constraints in the list
Pre: none
Post: return true if all plan items executed correctly, else false
getName
public String getName()
- Purpose: Gets the name of the Plan
Pre: none
Post: returns name of selector
getRank
public int getRank()
- Purpose: Runs the Sponsor to get the rank
Pre: none
Post: returns rank
addSpecialist
public boolean addSpecialist(String name)
- Purpose: Creates a new Specialist
Pre: none
Post: Specialist created, added to end of vector
addTask
public boolean addTask(String name)
- Purpose: Creates a new Task and adds it to the end of the list
Pre: none
Post: Task created, added to end of vector
addConstraint
public boolean addConstraint(String name)
- Purpose: Creates new Constaint
Pre: none
Post: Constraint created, added to end of vector
addItem
public boolean addItem(PlanItem newPlanItem)
- Purpose: Adds a new item to the plan list
Pre: duplicate name should not exist
Post: item added to planlist
insertItemAt
public boolean insertItemAt(int index,
PlanItem newPlanItem)
- Purpose: inserts the object into the vector
Pre: index <= Vector.size() && (newPlanItem must be type Task, Specialist or Constraint
Post: newPlanItem inserted at index
getItemAt
public PlanItem getItemAt(int index)
- Purpose: Gets the individual plan items
Pre: index >= 0 && index < planList.size()
Post: rtnval == planItems
removePlanItem
public boolean removePlanItem(String itemToRemoveName)
- remove a plan from the vector by its name
PRE: itemToRemoveName matchs name of an object in stepList
POST: vector does not include step with name itemToRemoveName
- Parameters:
- itemToRemove - object in vector to be removed.
- Returns:
- true if successful false if failed.
removeItemAt
public boolean removeItemAt(int index)
- remove a planItem from planList 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.
getSponsor
public Sponsor getSponsor()
- Purpose: Gets the reference to the sponsor
Pre: none
POst: retval == Sponsor
setPlanItemList
public void setPlanItemList(Vector pil)
- Purpose: Sets the plan list to an input vector of plan items
Pre: vector must contain all elements of PlanItem type
Post plan list set
setSponsor
public void setSponsor(Sponsor spons)
- Purpose: Sets the sponsor reference to a sponsor object
Pre: none
Post: sponsor reference set
All Packages Class Hierarchy This Package Previous Next Index