-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu.java
44 lines (36 loc) · 946 Bytes
/
Menu.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package restaurant;
import java.util.ArrayList;
import java.util.List;
public class Menu {
// Determine list to store any food or drink
private List<Food> foods;
private List<Drink> drinks;
}
// Constructor Menu() class
public Menu() {
this.foods = new ArrayList<>();
this.drinks = new ArrayList<>();
}
// Method to add food to List Food
public void addFood(Food food) {
foods.add(food);
}
public void removeFood(Food food) {
foods.remove(food);
}
// Method to add food to List Drink
public void addDrink(Drink drink) {
drinks.add(drink);
}
public void removeDrink(Drink drink) {
drinks.remove(drink);
}
// Getter for any arraylist on List Food
public List<Food> getFoods() {
return foods;
}
// Getter for any arraylist on List Drink
public List<Drink> getDrinks() {
return drinks;
}
}