Package Items

Class Order

java.lang.Object
Items.Order

public class Order extends Object
This class handles the Order Item.
Since:
2023-03-07
  • Field Details

    • orderID

      private long orderID
      Indentification number of the order
    • customerName

      private String customerName
      String holding the name of the customer who made the order
    • date

      private final LocalDateTime date
      LocalDateTime holding the current date
    • totalCost

      private double totalCost
      Total cost of the order
    • employeeId

      private long employeeId
      Identification number of the employee who created the order
    • items

      private Map<String,Long> 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 order
      orderId - ID number of the Order
  • Method Details

    • addItem

      public void addItem(String name, double price)
      Add an item to the order
      Parameters:
      name - of the item to add as a String
      price - of the item
    • removeItem

      public void removeItem(String name, double price)
      Removes an item from the order
      Parameters:
      name - of the item to remove as a String
      price - of the item
    • setCustomerName

      public void setCustomerName(String name)
      Parameters:
      name - new customerName
    • getCustomerName

      public String getCustomerName()
      Returns:
      customerName
    • getEmployeeId

      public long getEmployeeId()
      Returns:
      employeeId
    • setOrderId

      public void setOrderId(long orderID)
      Sets orderID
      Parameters:
      orderID - new identification number of the order
    • getOrderID

      public long getOrderID()
      Gets orderID
      Returns:
      orderID
    • getDate

      public LocalDateTime getDate()
      Gets date
      Returns:
      date
    • getTotalCost

      public double getTotalCost()
      Returns:
      totalCost
    • getItemCount

      public long getItemCount(String name)
      Gets the number of an item within items
      Parameters:
      name - of the item as a String
      Returns:
      amount of the item
    • getItemCount

      public String getItemCount()
      Update GUI to current item count
      Returns:
      updated count as String
    • getItems

      public Map<String,Long> getItems()
      Gets items
      Returns:
      items