Class OldValuesTable
- java.lang.Object
-
- ch.usi.si.codelounge.jsicko.plugin.OldValuesTable
-
public class OldValuesTable extends Object
A symbol table-like data structure used to hold old values, needed to support internal/recursive method calls.
-
-
Constructor Summary
Constructors Constructor Description OldValuesTable()Creates a new empty table.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(String key)Checks if a key has been stored in the table.voidenter(String methodSignature)Enters a new scope for a given method.ObjectgetValue(String key)Gets the value hold by the table in the current scope for a given key.voidleave()Leaves the current scope.voidputValue(String key, Object value)Adds a key-value pair in the current scope.
-
-
-
Method Detail
-
enter
public void enter(String methodSignature)
Enters a new scope for a given method.- Parameters:
methodSignature- the signature of the method.
-
leave
public void leave()
Leaves the current scope.
-
getValue
public Object getValue(String key)
Gets the value hold by the table in the current scope for a given key.- Parameters:
key- A string key (e.g., a variable name).- Returns:
- an object value.
-
putValue
public void putValue(String key, Object value)
Adds a key-value pair in the current scope.- Parameters:
key- a string key (e.g., a variable name).value- an object value.
-
containsKey
public boolean containsKey(String key)
Checks if a key has been stored in the table.- Parameters:
key- a string key (e.g., the name of a variable).- Returns:
trueiff the value has been stored in the table.
-
-