-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuComponent.java
More file actions
39 lines (30 loc) · 1.01 KB
/
MenuComponent.java
File metadata and controls
39 lines (30 loc) · 1.01 KB
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
package CompositePattern;
public abstract class MenuComponent {
// Composite methods used to add, remove, and get child components
public void add(MenuComponent menuComponent) {
throw new UnsupportedOperationException();
}
public void remove(MenuComponent menuComponent) {
throw new UnsupportedOperationException();
}
public MenuComponent getChild(int i) {
throw new UnsupportedOperationException();
}
public String getName() {
throw new UnsupportedOperationException();
}
// Operation methods used by the menuItems
public String getDescription() {
throw new UnsupportedOperationException();
}
public double getPrice() {
throw new UnsupportedOperationException();
}
public boolean isVegetarian() {
throw new UnsupportedOperationException();
}
// print is an operation method used by both Menu and MenuItem
public void print() {
throw new UnsupportedOperationException();
}
}