Class Ingredient

java.lang.Object
edu.ntnu.stud.model.Ingredient

public class Ingredient extends Object
The Ingredient class represents an ingredient in a recipe. Is also used in the Inventory class and the ShoppingList class.
  • Constructor Details

    • Ingredient

      public Ingredient(String ingName, int quantity)
      Create a new Ingredient object with the given name and quantity.
      Parameters:
      ingName - The name of the ingredient
      quantity - The quantity of the ingredient
  • Method Details

    • getIngName

      public String getIngName()
      Get the name of the ingredient.
      Returns:
      The name of the ingredient
    • getQuantity

      public int getQuantity()
      Get the quantity of the ingredient.
      Returns:
      The quantity of the ingredient
    • setQuantity

      public void setQuantity(int quantity)
      Set the quantity of the ingredient.
      Parameters:
      quantity - The new quantity of the ingredient