Class InventorySlot<T extends Item>

java.lang.Object
InventorySlot<T>

public class InventorySlot<T extends Item> extends Object
(The Container) This is a Generic class Instead of storing just items, the vending machine stores InventorySlot objects This class holds the actual item (like a Snack) and the quantity of that item remaining in the machine
  • Constructor Details

    • InventorySlot

      public InventorySlot(T item, int quantity)
      Class constructor for Inventory Slot
      Parameters:
      item - item for slot
      quantity - how much of item
  • Method Details

    • getItem

      public T getItem()
    • getQuantity

      public int getQuantity()
    • reduceQuantity

      public void reduceQuantity()
    • isInStock

      public boolean isInStock()