Package nl.rrd.wool.execution
Class WoolVariableStore
- java.lang.Object
-
- nl.rrd.wool.execution.WoolVariableStore
-
public class WoolVariableStore extends Object
Interface class forWoolVariableStore's. AWoolVariableStoreimplementation acts as an interface between Wool scripts (and the variables used in e.g. "if" and "set" statements therein) and the dialogue execution engine.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceWoolVariableStore.OnChangeListener
-
Constructor Summary
Constructors Constructor Description WoolVariableStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOnChangeListener(WoolVariableStore.OnChangeListener listener)Map<String,Object>getModifiableMap(boolean save, org.joda.time.DateTime time)Returns a modifiable map for this variable store.ObjectgetValue(String name)Retrieves the variable identified by the givenname, or returns null if no such variable is known.voidremoveOnChangeListener(WoolVariableStore.OnChangeListener listener)voidsetValue(String name, Object value, boolean save, org.joda.time.DateTime time)
-
-
-
Method Detail
-
addOnChangeListener
public void addOnChangeListener(WoolVariableStore.OnChangeListener listener)
-
removeOnChangeListener
public void removeOnChangeListener(WoolVariableStore.OnChangeListener listener)
-
setValue
public void setValue(String name, Object value, boolean save, org.joda.time.DateTime time)
- Parameters:
name- the name of the variable to store.value- the value of the variable to store.save- true if the variable should be saved in the database, false if it can be kept just in memorytime- the time (in the time zone of the user) that should be stored with this value. This is ignored and can be null if "save" is false
-
getValue
public Object getValue(String name)
Retrieves the variable identified by the givenname, or returns null if no such variable is known.
-
getModifiableMap
public Map<String,Object> getModifiableMap(boolean save, org.joda.time.DateTime time)
Returns a modifiable map for this variable store. If "save" is true, then any modification is saved to the database with the specified time.- Parameters:
save- true if the variable should be saved in the database, false if it can be kept just in memorytime- the time in the time zone of the user. This is ignored and can be null if "save" is false- Returns:
- the modifiable map
-
-