-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEncodeData.java
More file actions
26 lines (26 loc) · 778 Bytes
/
EncodeData.java
File metadata and controls
26 lines (26 loc) · 778 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
import java.util.*;
public class EncodeData{
Map<String, Map<String, Integer>> data;
EncodeData(){
this.data = new HashMap<>();
}
void newMap(String key){
this.data.put(key, new HashMap<>());
}
void addData(String key, String[] subKey, int[] k){
for(int i = 0; i < subKey.length; i++)
this.data.get(key).put(subKey[i], k[i]);
}
void addSingleData(String key, String subkey, int k){
this.data.get(key).put(subkey, k);
}
int getData(String key, String subkey){
return data.get(key).get(subkey);
}
Map<String, Map<String, Integer>> allData(){
return this.data;
}
boolean checkSubkey(String key, String subkey){
return data.get(key).containsKey(subkey);
}
}