-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOrder.java
57 lines (49 loc) · 1016 Bytes
/
Order.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import java.util.ArrayList;
public class Order
{
private ArrayList<Product> products;
private int column;
private int row;
private boolean isDelivered;
private static int order_id = -1;
/*Constructor*/
public Order()
{
products = new ArrayList<Product>();
order_id++;
}
public void makeOrder(int row, int col)
{
column = col;
this.row = row;
isDelivered = false;
}
/*Add item to order*/
public boolean addItem(Product productItem)
{
return products.add(productItem);
}
/*Return column*/
public int getColumn()
{
return column;
}
/*Get row*/
public int getRow()
{
return row;
}
/*Size of order*/
public int orderSize()
{
return products.size();
}
public void isDelivered(boolean status)
{
isDelivered = status;
}
public boolean getDeliveryStatus()
{
return isDelivered;
}
}//End class