Package Items
Class Order
java.lang.Object
Items.Order
This class handles the Order Item.
- Since:
- 2023-03-07
-
Field Summary
Modifier and TypeFieldDescriptionprivate String
String
holding the name of the customer who made the orderprivate final LocalDateTime
LocalDateTime
holding the current dateprivate long
Identification number of the employee who created the orderMap
holding each item's name as a key and its coresponding quantity as value.private long
Indentification number of the orderprivate double
Total cost of the order -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an item to the orderGetscustomerName
getDate()
Getsdate
long
GetsemployeeId
Update GUI to current item countlong
getItemCount
(String name) Gets the number of an item withinitems
getItems()
Getsitems
long
GetsorderID
double
GetstotalCost
void
removeItem
(String name, double price) Removes an item from the ordervoid
setCustomerName
(String name) SetscustomerName
void
setOrderId
(long orderID) SetsorderID
-
Field Details
-
orderID
private long orderIDIndentification number of the order -
customerName
String
holding the name of the customer who made the order -
date
LocalDateTime
holding the current date -
totalCost
private double totalCostTotal cost of the order -
employeeId
private long employeeIdIdentification number of the employee who created the order -
items
Map
holding each item's name as a key and its coresponding quantity as value.
-
-
Constructor Details
-
Order
public Order()Construct an Order -
Order
public Order(long employeeId) Construct an Order- Parameters:
employeeId
- ID number of the Employee completing the order
-
Order
public Order(long employeeId, long orderId) Construct an Order- Parameters:
employeeId
- ID number of the Employee completing the orderorderId
- ID number of the Order
-
-
Method Details
-
addItem
Add an item to the order- Parameters:
name
- of the item to add as aString
price
- of the item
-
removeItem
Removes an item from the order- Parameters:
name
- of the item to remove as aString
price
- of the item
-
setCustomerName
SetscustomerName
- Parameters:
name
- newcustomerName
-
getCustomerName
GetscustomerName
- Returns:
customerName
-
getEmployeeId
public long getEmployeeId()GetsemployeeId
- Returns:
employeeId
-
setOrderId
public void setOrderId(long orderID) SetsorderID
- Parameters:
orderID
- new identification number of the order
-
getOrderID
public long getOrderID()GetsorderID
- Returns:
orderID
-
getDate
Getsdate
- Returns:
date
-
getTotalCost
public double getTotalCost()GetstotalCost
- Returns:
totalCost
-
getItemCount
Gets the number of an item withinitems
- Parameters:
name
- of the item as aString
- Returns:
- amount of the item
-
getItemCount
Update GUI to current item count- Returns:
- updated count as
String
-
getItems
Getsitems
- Returns:
items
-