Class Inventory
java.lang.Object
edu.ntnu.stud.idatt1005.team3.model.Inventory
Represents an inventory of food items.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFoodItem
(FoodItem foodItem) Adds a food item to the inventory.void
Adds a food item to the inventory.Displays the current inventory.getFoodItemById
(int id) Get FoodItem by ID.
-
Constructor Details
-
Inventory
public Inventory()Constructs an empty inventory.
-
-
Method Details
-
addItem
Adds a food item to the inventory.- Parameters:
name
- The name of the food item.quantity
- The quantity of the food item.
-
addFoodItem
Adds a food item to the inventory.- Parameters:
foodItem
- The food item to add.
-
displayInventory
Displays the current inventory. -
getFoodItemById
Get FoodItem by ID.- Parameters:
id
- The id of the food item.
-