MCPcopy Create free account
hub / github.com/InterviewReady/Low-Level-Design / placeUnit

Method placeUnit

InventorySystem.java:19–28  ·  view source on GitHub ↗
(Unit unit)

Source from the content-addressed store, hash-verified

17 }
18
19 public static void placeUnit(Unit unit) {
20 for (Map.Entry<Location, Unit> entry: locationMap.entrySet()){
21 // if (SimpleStrategy.works())
22 //get lock on entry.getKey()
23 if(entry.getValue()==null){
24 unit.locationId = entry.getKey().id;
25 }
26 //release lock
27 }
28 }
29
30 public static void removeUnit(Product product) {
31 for (Map.Entry<Location, Unit> entry: locationMap.entrySet()){

Callers

nothing calls this directly

Calls 2

getValueMethod · 0.80
getKeyMethod · 0.80

Tested by

no test coverage detected