Class Inventory

java.lang.Object
edu.ntnu.stud.idatt1005.team3.model.Inventory

public class Inventory extends Object
Represents an inventory of food items.
  • Constructor Details

    • Inventory

      public Inventory()
      Constructs an empty inventory.
  • Method Details

    • addItem

      public void addItem(String name, Double quantity, String unit, int id)
      Adds a food item to the inventory.
      Parameters:
      name - The name of the food item.
      quantity - The quantity of the food item.
    • addFoodItem

      public void addFoodItem(FoodItem foodItem)
      Adds a food item to the inventory.
      Parameters:
      foodItem - The food item to add.
    • displayInventory

      public String displayInventory()
      Displays the current inventory.
    • getFoodItemById

      public FoodItem getFoodItemById(int id)
      Get FoodItem by ID.
      Parameters:
      id - The id of the food item.