-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoffeeDecorator.java
More file actions
42 lines (39 loc) · 1.05 KB
/
Copy pathCoffeeDecorator.java
File metadata and controls
42 lines (39 loc) · 1.05 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
40
41
42
/*
* Author: Sam Braude (Red ID: 826984009)
* Intermediate Computer Programming Lab (CS 160L)
* Erin Ratelle
* June 28, 2023
*/
import java.util.List;
public abstract class CoffeeDecorator implements Coffee {
/*
* Baseline for all extra ingredients.
*/
private Coffee coffee;
/*
* Initialize a new coffee for order.
*/
public CoffeeDecorator(Coffee c) {
coffee = c;
}
/*
* Returns the cost of the coffee. This is used
* to properly construct the user's order and
* to write to the OrderLog.txt file.
*/
public double getCost() { return coffee.getCost(); }
/*
* Contains the ingredients inside the coffee/order
*/
public List<String> getIngredients() {
return null;
}
/*
* Print a description of what the ingredient is.
* This is used to properly construct the user's order
* and to write to the OrderLog.txt file.
*/
public String printCoffee() {
return coffee.printCoffee();
}
}