-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOrderDetail.java
56 lines (51 loc) · 1.19 KB
/
OrderDetail.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
/**
* Kazunori Hayashi
* Version 1.0 29/7/2013
*/
public class OrderDetail
{
private int itemID;
private String itemName;
private double price;
private byte quantity;
private double totalPrice;
/**
* Constructor for objects of class OrderDetail
*/
public OrderDetail(MenuItem newMenuItem, byte newQuantity)
{
this.itemID = newMenuItem.getID();
this.itemName = newMenuItem.getName();
this.price = newMenuItem.getPrice();
this.quantity = newQuantity;
this.totalPrice = this.price * this.quantity;
}
/**************************************************
* Getter
*************************************************/
public int getItemID()
{
return this.itemID;
}
public String getItemName()
{
return this.itemName;
}
public double getPrice()
{
return this.price;
}
public byte getQuantity()
{
return this.quantity;
}
public double getTotalPrice()
{
return this.totalPrice;
}
public void addQuantity(byte add)
{
quantity += add;
totalPrice = price * quantity;
}
}