Uses of Enum Class
no.ntnu.idatt1002.demo.data.recipes.FoodItem

Packages that use FoodItem
Package
Description
 
  • Uses of FoodItem in no.ntnu.idatt1002.demo.data.recipes

    Modifier and Type
    Method
    Description
    Ingredient.getFoodType()
    The method returns the food type that the ingredient belongs to among the valid types in the FoodItem enum class.
    static FoodItem
    FoodItem.valueOf(String name)
    Returns the enum constant of this class with the specified name.
    static FoodItem[]
    FoodItem.values()
    Returns an array containing the constants of this enum class, in the order they are declared.
    Methods in no.ntnu.idatt1002.demo.data.recipes that return types with arguments of type FoodItem
    Modifier and Type
    Method
    Description
    IngredientsAtHand.getIngredientsAtHand()
    The method returns the collection of ingredients at hand as an arraylist of FoodItem enum constants.
    Methods in no.ntnu.idatt1002.demo.data.recipes with parameters of type FoodItem
    Modifier and Type
    Method
    Description
    void
    IngredientsAtHand.addIngredient(FoodItem ingredient)
    The method takes in an ingredient object and adds it to the collection of ingredients at hand.
    boolean
    Recipe.addIngredient(FoodItem ingredientType, double amount, MeasuringUnit unit)
    The method adds an ingredient to the recipe if it is not already in the recipe, in which case the existing ingredient of the same food type is updated with the parameters provided to this method.
    boolean
    IngredientsAtHand.atHand(FoodItem foodItem)
    The method takes in a constant of the FoodType enum class and checks if it is present in the collection.
    Recipe.getIngredient(FoodItem ingredientType)
    The method takes in a constant of the FoodItem enum class and searches for it among the recipe's ingredients.
    boolean
    IngredientsAtHand.removeIngredient(FoodItem ingredientType)
    The method takes in a value of the FoodItem enum as a parameter and removes it from the collection of ingredients at hand if it exists and returns true.
    void
    Ingredient.setFoodType(FoodItem foodType)
    The method takes in a value of the FoodItem enum and sets the ingredient's foodType field equal to this constant.
    Constructors in no.ntnu.idatt1002.demo.data.recipes with parameters of type FoodItem
    Modifier
    Constructor
    Description
     
    Ingredient(FoodItem ingredient, double amount, MeasuringUnit unit)
    The constructor of a new Ingredient object takes in three mandatory fields; ingredient type as defined in the enum class FoodItem, an amount and a unit of measure defined in the enum class MeasuringUnit.
     
    RecipeIngredient(FoodItem ingredient, double amount, MeasuringUnit unit)
    The constructor of a RecipeIngredient object inherits from the superclass Ingredient.