4040 */
4141
4242public interface SimpleContext {
43- /**
44- * Enters a scope
45- */
46- void enterScope ();
47-
48- /**
49- * Enters a scope and defines the given entries to null.
50- * @param entries a set of string
51- */
52- void enterScope (Set <AbstractVariable > entries );
53-
54- /**
55- * Defines the given variables
56- */
57- void defineVariables (Set <AbstractVariable > vars );
58-
59- /**
60- * Returns the current scope variables (AbstractVariables) in a set
61- */
62- Set <AbstractVariable > getCurrentScopeVariables ();
63-
64- /**
65- * Returns the current scope variable names in a set
66- */
67- Set <String > getCurrentScopeVariableNames ();
68-
69- /**
70- * Leaves the current scope
71- * @return the set of the variables (strings) defined in the current scope
72- */
73- Set leaveScope ();
74-
75- /**
76- * Tests whether a variable is defined in this context
77- * @param name the name of the entry
78- * @return false if the variable is undefined
79- */
80- boolean isDefinedVariable (String name );
81-
82- /**
83- * Tests whether a variable is final in this context
84- * @param name the name of the entry
85- * @return false if the variable is not final
86- * @exception IllegalStateException if the variable is not defined
87- */
88- boolean isFinal (String name );
89-
90- /**
91- * Defines a new variable in the current scope
92- * @param name the name of the new entry
93- * @param value the value of the entry
94- * @exception IllegalStateException if the variable is already defined
95- */
96- void define (String name , Object value );
97-
98- /**
99- * Defines a new constant variable in the current scope
100- * @param name the name of the new entry
101- * @param value the value of the entry
102- * @exception IllegalStateException if the variable is already defined
103- */
104- void defineConstant (String name , Object value );
105-
106- /**
107- * Returns the value of a variable with the given name
108- * @param name the name of the value to get
109- * @exception IllegalStateException if the variable is not defined
110- */
111- Object get (String name );
112-
113- /**
114- * Sets the value of a defined variable
115- * @param name the name of the new entry
116- * @param value the value of the entry
117- * @exception IllegalStateException if the variable is not defined
118- */
119- void set (String name , Object value );
120-
121- /**
122- * Defines a new constant variable in the current scope
123- * @param name the name of the new entry
124- * @param value the value of the entry
125- */
126- void setConstant (String name , Object value );
127-
128- /**
129- * Defines a new variable in the current scope
130- * @param name the name of the new entry
131- * @param value the value of the entry
132- */
133- void setVariable (String name , Object value );
134-
135- /**
136- * Creates a map that contains the constants in this context
137- */
138- Map getConstants ();
139- }
43+ /**
44+ * Enters a scope
45+ */
46+ void enterScope ();
47+
48+ /**
49+ * Enters a scope and defines the given entries to null.
50+ * @param entries a set of string
51+ */
52+ void enterScope (Set <AbstractVariable > entries );
53+
54+ /**
55+ * Defines the given variables
56+ */
57+ void defineVariables (Set <AbstractVariable > vars );
58+
59+ /**
60+ * Returns the current scope variables (AbstractVariables) in a set
61+ */
62+ Set <AbstractVariable > getCurrentScopeVariables ();
63+
64+ /**
65+ * Returns the current scope variable names in a set
66+ */
67+ Set <String > getCurrentScopeVariableNames ();
68+
69+ /**
70+ * Leaves the current scope
71+ * @return the set of the variables (strings) defined in the current scope
72+ */
73+ Set leaveScope ();
74+
75+ /**
76+ * Tests whether a variable is defined in this context
77+ * @param name the name of the entry
78+ * @return false if the variable is undefined
79+ */
80+ boolean isDefinedVariable (String name );
81+
82+ /**
83+ * Tests whether a variable is final in this context
84+ * @param name the name of the entry
85+ * @return false if the variable is not final
86+ * @exception IllegalStateException if the variable is not defined
87+ */
88+ boolean isFinal (String name );
89+
90+ /**
91+ * Defines a new variable in the current scope
92+ * @param name the name of the new entry
93+ * @param value the value of the entry
94+ * @exception IllegalStateException if the variable is already defined
95+ */
96+ void define (String name , Object value );
97+
98+ /**
99+ * Defines a new constant variable in the current scope
100+ * @param name the name of the new entry
101+ * @param value the value of the entry
102+ * @exception IllegalStateException if the variable is already defined
103+ */
104+ void defineConstant (String name , Object value );
105+
106+ /**
107+ * Returns the value of a variable with the given name
108+ * @param name the name of the value to get
109+ * @exception IllegalStateException if the variable is not defined
110+ */
111+ Object get (String name );
112+
113+ /**
114+ * Sets the value of a defined variable
115+ * @param name the name of the new entry
116+ * @param value the value of the entry
117+ * @exception IllegalStateException if the variable is not defined
118+ */
119+ void set (String name , Object value );
120+
121+ /**
122+ * Defines a new constant variable in the current scope
123+ * @param name the name of the new entry
124+ * @param value the value of the entry
125+ */
126+ void setConstant (String name , Object value );
127+
128+ /**
129+ * Defines a new variable in the current scope
130+ * @param name the name of the new entry
131+ * @param value the value of the entry
132+ */
133+ void setVariable (String name , Object value );
134+
135+ /**
136+ * Creates a map that contains the constants in this context
137+ */
138+ Map getConstants ();
139+
140+
141+ /**
142+ * Sets a revert point such that calling revert will remove
143+ * any variable or constant bindings set after this point.
144+ */
145+ void setRevertPoint ();
146+
147+ /**
148+ * Removes any bindings set after the last call to setRevertPoint
149+ */
150+ void revert ();
151+
152+ }
0 commit comments