Class StepRegister
java.lang.Object
stud.ntnu.idatt1005.pantrypal.registers.StepRegister
Represents a list of steps in a recipe.
Contains methods for adding and removing steps.
Goal: To represent a list of steps in a recipe.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a step to the list of steps.getSteps()
Returns the list of steps.void
removeStep
(int index) Removes a step from the list of steps.void
removeStep
(String step) Removes a step from the list of steps.
-
Field Details
-
steps
A list of steps in a recipe.
-
-
Constructor Details
-
StepRegister
public StepRegister()Constructor for Steps. Initializes the list of steps.
-
-
Method Details
-
getSteps
Returns the list of steps.- Returns:
- steps The list of steps.
-
addStep
Adds a step to the list of steps.- Parameters:
step
- The step to be added to the steps list.- Throws:
IllegalArgumentException
-
removeStep
Removes a step from the list of steps.- Parameters:
index
- The index of the step to be removed from the steps list.- Throws:
IndexOutOfBoundsException
-
removeStep
Removes a step from the list of steps.- Parameters:
step
- The step to be removed from the steps list.
-