Index
All Classes and Interfaces|All Packages|Serialized Form
B
- Beverage - Class in Unnamed Package
-
(The Basic Products) These classes extend Item Snack adds a specific boolean property to check if it's vegan, while Beverage adds a boolean to check if it is cold They both override displayDetails() to print their specific information
- Beverage(String, double, boolean) - Constructor for class Beverage
D
- displayDetails() - Method in class Beverage
- displayDetails() - Method in class Item
- displayDetails() - Method in class PerishableItem
- displayDetails() - Method in class Snack
- displayMenu() - Method in class VendingMachine
E
- ExpiredProductException - Exception Class in Unnamed Package
-
Exception that is thrown when item is expired Extends exception
- ExpiredProductException(String) - Constructor for exception class ExpiredProductException
G
- getItem() - Method in class InventorySlot
- getName() - Method in class Item
- getPrice() - Method in class Item
- getQuantity() - Method in class InventorySlot
I
- InsufficientFundsException - Exception Class in Unnamed Package
-
Exception that is thrown when payment is insufficient Extends exception
- InsufficientFundsException(String) - Constructor for exception class InsufficientFundsException
- InventorySlot<T> - Class in Unnamed Package
-
(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
- InventorySlot(T, int) - Constructor for class InventorySlot
-
Class constructor for Inventory Slot
- isExpired() - Method in class Item
- isExpired() - Method in class PerishableItem
- isInStock() - Method in class InventorySlot
- Item - Class in Unnamed Package
-
(The Blueprint) This is the abstract base class It defines the universal properties every product has (a name and a price) and forces all child classes to create their own version of a displayDetails() method
- Item(String, double) - Constructor for class Item
-
Class constructor for item
L
- loadInventoryFromFile(String) - Method in class VendingMachine
M
- main(String[]) - Static method in class Main
- Main - Class in Unnamed Package
-
(The User Interface) This contains the public static void main method It is responsible for the infinite while loop that keeps the program running, asking the user for input via Scanner, and catching any errors if the user does something wrong
- Main() - Constructor for class Main
O
- OutOfStockException - Exception Class in Unnamed Package
-
Exception that is thrown when item is out of stock Extends exception
- OutOfStockException(String) - Constructor for exception class OutOfStockException
P
- PerishableItem - Class in Unnamed Package
-
(The Advanced Product) This class extends Snack It introduces a java.util.Date property for an expiration date It overrides the isExpired() method from the base class to check if today's date is past the item's expiration date
- PerishableItem(String, double, boolean, Date) - Constructor for class PerishableItem
-
Class constructor for perishable item
- purchase(String, double) - Method in class VendingMachine
R
- reduceQuantity() - Method in class InventorySlot
S
- Snack - Class in Unnamed Package
-
(The Basic Products) These classes extend Item Snack adds a specific boolean property to check if it's vegan, while Beverage adds a boolean to check if it is cold They both override displayDetails() to print their specific information
- Snack(String, double, boolean) - Constructor for class Snack
V
- VendingMachine - Class in Unnamed Package
-
(The Brain) This is the core engine It reads the inventory.txt file, stores the items in a HashMap, processes the user's money, dispenses the item, reduces the stock, and generates the receipt
- VendingMachine() - Constructor for class VendingMachine
-
Class constructor for Vending Machine
All Classes and Interfaces|All Packages|Serialized Form