-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathManager.java
More file actions
36 lines (25 loc) · 854 Bytes
/
Manager.java
File metadata and controls
36 lines (25 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.booleanuk.core;
import java.util.HashMap;
import java.util.Map;
public class Manager {
public static HashMap<Item, Integer> currentStock; //Should I use hashMap instead here maybe?
public static Integer maxCapacity;
public Manager(HashMap<Item, Integer> currentStock, Integer maxCapacity) {
Manager.currentStock = currentStock;
Manager.maxCapacity = maxCapacity;
}
public boolean setMaxCapacity(Integer maxCapacity) {
if (maxCapacity >0 && maxCapacity <= 100){
Manager.maxCapacity = maxCapacity;
return true;
}
return false;
}
public static boolean setCurrentStock(Item item, Integer quantity){
if (item!=null){
Manager.currentStock.put(item, quantity);
return true;
}
return false;
}
}