Package edu.ntnu.stud.model
Class Ingredient
java.lang.Object
edu.ntnu.stud.model.Ingredient
The Ingredient class represents an ingredient in a recipe.
Is also used in the Inventory class and the ShoppingList class.
-
Constructor Summary
ConstructorsConstructorDescriptionIngredient
(String ingName, int quantity) Create a new Ingredient object with the given name and quantity. -
Method Summary
Modifier and TypeMethodDescriptionGet the name of the ingredient.int
Get the quantity of the ingredient.void
setQuantity
(int quantity) Set the quantity of the ingredient.
-
Constructor Details
-
Ingredient
Create a new Ingredient object with the given name and quantity.- Parameters:
ingName
- The name of the ingredientquantity
- The quantity of the ingredient
-
-
Method Details
-
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
-