-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrderList.java
More file actions
31 lines (27 loc) · 901 Bytes
/
OrderList.java
File metadata and controls
31 lines (27 loc) · 901 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
import java.util.*;
class OrderList extends ParentList {
private static final long serialVersionUID = 1L;
private LinkedList<Order> orderList = new LinkedList<Order>();
private static OrderList OrderListObject;
public static OrderList instance() {
if (OrderListObject == null) {
return (OrderListObject = new OrderList());
} else
return OrderListObject;
}
public Order searchOrder(int orderID) {
if (orderList.isEmpty())
return null;
else {
Iterator<Thing> orderList1 = OrderListObject.getList();
while (orderList1.hasNext()) {
Order order = (Order) orderList1.next();
int checkID = order.getOrderID();
if (checkID == orderID) {
return order;
}
}
}
return null;
}
}