1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sf.zel.vm;
20
21 import java.util.HashMap;
22 import net.sf.zel.math.ExtendedMathContext;
23
24
25
26
27
28 public final class Memory extends HashMap
29 {
30
31
32
33 public Object getValue(final String name) throws ParseException, ZExecutionException
34 {
35 return Program.getValue(this, name);
36 }
37
38
39
40
41
42
43
44 public void addValue(final String name, final Object value, final ExtendedMathContext mc) throws ParseException, ZExecutionException
45 {
46 Program.addValue(this, name, value, mc);
47 }
48
49 public void addValue(final String name, final Object value) throws ParseException, ZExecutionException
50 {
51 addValue(name, value, ExtendedMathContext.CURRENT_EXTENDED_MATH_CONTEXT.get());
52 }
53
54
55
56
57
58
59 public void linkMem(final String name, final java.util.Map value) throws ParseException, ZExecutionException
60 {
61 Program.linkMem(this, name, value);
62 }
63
64
65
66
67
68
69 public String dumpCore()
70 {
71 return Program.dumpCore("[root]", this, 1, -1);
72 }
73
74
75
76
77 public String dumpCore(final int maxLevel)
78 {
79 return Program.dumpCore("[root]", this, 1, maxLevel + 1);
80 }
81
82
83
84
85 @Override
86 public String toString()
87 {
88 return dumpCore(2);
89 }
90 }