-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOrder.java
More file actions
36 lines (29 loc) · 759 Bytes
/
Copy pathOrder.java
File metadata and controls
36 lines (29 loc) · 759 Bytes
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
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
public class Order {
private String orderID;
private Date orderDate;
private List<item> items = new ArrayList<item>();
private static long idCounter = 0;
public Order() {
orderID = String.valueOf(idCounter++);
}
public String getOrderID() {
return orderID;
}
public void setOrderDate(Date date) {
this.orderDate = date;
}
public Date getOrderDate() {
return orderDate;
}
public void addItems(List<item> orderItems) {
for (int i = 0; i < orderItems.size(); i++) {
items.add(orderItems.get(i));
}
}
public List<item> getItems() {
return items;
}
}