java.lang.Object
stud.ntnu.idatt1005.pantrypal.registers.StepRegister

public class StepRegister extends Object
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 Details

    • steps

      List<String> steps
      A list of steps in a recipe.
  • Constructor Details

    • StepRegister

      public StepRegister()
      Constructor for Steps. Initializes the list of steps.
  • Method Details

    • getSteps

      public List<String> getSteps()
      Returns the list of steps.
      Returns:
      steps The list of steps.
    • addStep

      public void addStep(String step) throws IllegalArgumentException
      Adds a step to the list of steps.
      Parameters:
      step - The step to be added to the steps list.
      Throws:
      IllegalArgumentException
    • removeStep

      public void removeStep(int index) throws IndexOutOfBoundsException
      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

      public void removeStep(String step)
      Removes a step from the list of steps.
      Parameters:
      step - The step to be removed from the steps list.