MCPcopy
hub / github.com/ashishps1/awesome-low-level-design / get

Method get

solutions/java/src/lrucache/LRUCache.java:17–22  ·  view source on GitHub ↗
(K key)

Source from the content-addressed store, hash-verified

15 }
16
17 public synchronized V get(K key) {
18 if (!map.containsKey(key)) return null;
19 Node<K, V> node = map.get(key);
20 dll.moveToFront(node);
21 return node.value;
22 }
23
24 public synchronized void put(K key, V value) {
25 if (map.containsKey(key)) {

Callers 15

runMethod · 0.95
testSelectCoffeeMethod · 0.45
testIngredientRefillMethod · 0.45
reserveTableMethod · 0.45
placeOrderMethod · 0.45
markOrderPreparingMethod · 0.45
markOrderReadyMethod · 0.45
markOrderServedMethod · 0.45
getBillMethod · 0.45
makePaymentMethod · 0.45
markItemsAsReadyMethod · 0.45

Calls 1

moveToFrontMethod · 0.80

Tested by 3

testSelectCoffeeMethod · 0.36
testIngredientRefillMethod · 0.36