Class Context
- java.lang.Object
-
- org.eclipse.viatra.transformation.evm.api.Context
-
public class Context extends java.lang.ObjectA context is an associative store that is accessible during the execution of the EVM, and thus usable by the Sceduler, Executor, RuleBase, Rule Instances, Activations and Jobs. In order to separate different users from each other, values can be accessed (get/put/remove) with a key.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedContext()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclear()Clears all data from the context.static Contextcreate()Static helper method to create an empty Context.java.lang.Objectget(java.lang.String key)Returns the value corresponding to the given key.java.lang.Objectput(java.lang.String key, java.lang.Object value)Puts the value into the context with the given keyjava.lang.Objectremove(java.lang.String key)Removes any existing value for the given key from the context.
-
-
-
Method Detail
-
create
public static Context create()
Static helper method to create an empty Context.
-
get
public java.lang.Object get(java.lang.String key)
Returns the value corresponding to the given key.- Parameters:
key-- Returns:
- the value in the context for the key
-
put
public java.lang.Object put(java.lang.String key, java.lang.Object value)Puts the value into the context with the given key- Parameters:
key-value-- Returns:
- the previous value for the key, or null
-
remove
public java.lang.Object remove(java.lang.String key)
Removes any existing value for the given key from the context.- Parameters:
key-- Returns:
- the value if exists, null otherwise
-
clear
protected void clear()
Clears all data from the context.
-
-