public class DeepOOState extends GenericOOState
GenericOOStatein which the
copy()operations performs a deep copy (
DeepCopyState) of all
ObjectInstanceobjects, thereby allows safe modification of any of its
ObjectInstanceobjects without using the
GenericOOState.touch(String)method. As a result, this implementation will cause greater memory overhead in your algorithms, but requires less management on a client that is manipulating the states (e.g., defining transition dynamics).
|Constructor and Description|
|Modifier and Type||Method and Description|
Returns a copy of this state suitable for creating state transitions.
Sets the value for the given variable key.
addObject, get, getObjectsByClass, getObjectsMap, getOrGenerateObjectClassList, numObjects, object, objects, objectsOfClass, removeObject, renameObject, setObjectsByClass, setObjectsMap, toString, touch, variableKeys
public DeepOOState(OOState srcOOState)
public DeepOOState(ObjectInstance... objects)
public MutableState set(java.lang.Object variableKey, java.lang.Object value)
public DeepOOState copy()
ShallowCopyStateannotations. If it is a shallow copy, you should not *directly* modify any fields of a copied state without copying the fields first, or it could contaminate the state from which the copy was made. Alternatively, use the
MutableState.set(Object, Object)method to modify
ShallowCopyStatecopied states, which for
ShallowCopyStateinstances should perform a safe copy-on-write operation.