MCPcopy Create free account
hub / github.com/Anchals24/Low-Level-Design / displayInventory

Method displayInventory

StateDesignPattern/Main.java:73–83  ·  view source on GitHub ↗
(VendingMachine vendingMachine)

Source from the content-addressed store, hash-verified

71 }
72
73 private static void displayInventory(VendingMachine vendingMachine){
74
75 ItemShelf[] slots = vendingMachine.getInventory().getItemShelves();
76 for (int i = 0; i < slots.length; i++) {
77
78 System.out.println("CodeNumber: " + slots[i].getCode() +
79 " Item: " + slots[i].getItem().getType().name() +
80 " Price: " + slots[i].getItem().getPrice() +
81 " isAvailable: " + !slots[i].isSoldOut());
82 }
83 }
84}

Callers 1

mainMethod · 0.95

Calls 7

getItemShelvesMethod · 0.80
getInventoryMethod · 0.80
getCodeMethod · 0.80
getTypeMethod · 0.80
isSoldOutMethod · 0.80
getItemMethod · 0.45
getPriceMethod · 0.45

Tested by

no test coverage detected