Package: Store

Store

nameinstructionbranchcomplexitylinemethod
Store()
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getValue(Number)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
register(Number, Object)
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
reset()
M: 20 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
staticReg(Number, Class)
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
toString()
M: 53 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 12 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package org.overture.codegen.runtime.traces;
2:
3: import java.util.HashMap;
4: import java.util.Map;
5:
6: import org.overture.codegen.runtime.Utils;
7:
8: public class Store
9: {
10:         private Map<Number, ModuleCopy> values;
11:
12:         public Store()
13:         {
14:                 this.values = new HashMap<>();
15:         }
16:
17:         public void register(Number id, Object val)
18:         {
19:                 values.put(id, new ObjectCopy(val));
20:         }
21:
22:         public void staticReg(Number id, Class<?> clazz)
23:         {
24:                 values.put(id, new ModuleCopy(clazz));
25:         }
26:
27:         public Object getValue(Number id)
28:         {
29:                 return values.get(id).getValue();
30:         }
31:
32:         public void reset()
33:         {
34:•                for (Number k : values.keySet())
35:                 {
36:                         values.get(k).reset();
37:                 }
38:         }
39:
40:         @Override
41:         public String toString()
42:         {
43:                 StringBuilder sb = new StringBuilder();
44:                 sb.append("{");
45:
46:                 String sep = "";
47:
48:•                for (Number k : values.keySet())
49:                 {
50:                         sb.append(sep);
51:                         sb.append(Utils.toString(k));
52:                         sb.append(" |-> ");
53:                         sb.append(Utils.toString(values.get(k)));
54:                         sep = ", ";
55:                 }
56:
57:                 sb.append("}");
58:
59:                 return sb.toString();
60:         }
61: }