Package jadex.rules.state
Interface IOAVState
- 
- All Known Implementing Classes:
- CopyState,- OAVAbstractState,- OAVContentIdState,- OAVMixedWeakState,- OAVState,- OAVWeakState
 
 public interface IOAVStateAn object holding the state as OAV triples (object, attribute, value).
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAttributeValue(java.lang.Object object, OAVAttributeType attribute, java.lang.Object value)Add an attribute of an object to the given value.voidaddExternalObjectUsage(java.lang.Object id, java.lang.Object external)Add an external usage of a state object.voidaddJavaRootObject(java.lang.Object object)Add a Java object as root object.voidaddStateListener(IOAVStateListener listener, boolean bunch)Add a new state listener.voidaddSubstate(IOAVState substate)Add a substate.booleancontainsKey(java.lang.Object object, OAVAttributeType attribute, java.lang.Object key)Test if a key is contained in the map attribute.booleancontainsObject(java.lang.Object object)Test if the state contains a specific object.java.lang.ObjectcreateObject(OAVObjectType type)Create an object.java.lang.ObjectcreateRootObject(OAVObjectType type)Create a root object.voiddispose()Dispose the state.voiddropObject(java.lang.Object object)Drop an object from the state.booleanequals(java.lang.Object a, java.lang.Object b)Test if two values are equal according to current identity/equality settings.voidexpungeStaleObjects()Expunge stale objects.java.util.ListfindCycle(java.util.Collection objects)Find a cycle in a given set of objects.java.util.CollectiongetAttributeKeys(java.lang.Object object, OAVAttributeType attribute)Get the keys of an attribute of an object.java.lang.ObjectgetAttributeValue(java.lang.Object object, OAVAttributeType attribute)Get an attribute value of an object.java.lang.ObjectgetAttributeValue(java.lang.Object object, OAVAttributeType attribute, java.lang.Object key)Get an attribute value of an object.java.util.CollectiongetAttributeValues(java.lang.Object object, OAVAttributeType attribute)Get the values of an attribute of an object.java.util.IteratorgetDeepObjects()Get all objects in the state and its substates.java.util.IteratorgetObjects()Get all objects in the state.IProfilergetProfiler()Get the profiler.java.util.CollectiongetReferencingObjects(java.lang.Object value)Get those objects referencing a given object.java.util.IteratorgetRootObjects()Get the root objects of the state.intgetSize()Get the number of objects in the state.IOAVState[]getSubstates()Get the substates.ISynchronizatorgetSynchronizator()Get the synchronizator (if any).OAVObjectTypegetType(java.lang.Object object)Get the type of an object.OAVTypeModelgetTypeModel()Get the type model.java.util.CollectiongetUnreferencedObjects()Get all unreferenced objects.booleanisIdentifier(java.lang.Object object)Test if the object represents an identifier.booleanisJavaIdentity()Flag indicating that java objects are stored by identity instead of equality.voidnotifyEventListeners()Throw collected events and notify the listeners.voidremoveAttributeValue(java.lang.Object object, OAVAttributeType attribute, java.lang.Object value)Remove an attribute of an object to the given value.voidremoveExternalObjectUsage(java.lang.Object id, java.lang.Object external)Remove an external usage of a state object.voidremoveJavaRootObject(java.lang.Object object)Remove a Java object from root objects.voidremoveStateListener(IOAVStateListener listener)Remove a state listener.voidsetAttributeValue(java.lang.Object object, OAVAttributeType attribute, java.lang.Object value)Set an attribute of an object to the given value.voidsetProfiler(IProfiler profiler)Set the profiler.voidsetSynchronizator(ISynchronizator synchronizator)Set the synchronizator.
 
- 
- 
- 
Method Detail- 
getTypeModelOAVTypeModel getTypeModel() Get the type model.- Returns:
- The type model.
 
 - 
disposevoid dispose() Dispose the state.
 - 
createObjectjava.lang.Object createObject(OAVObjectType type) Create an object. Creates an object identifier that can be used to store/retrieve attribute values. May reuse old object identifiers for performance.- Parameters:
- type- The object type (null for defining meta types).
- Returns:
- An object identifier.
 
 - 
createRootObjectjava.lang.Object createRootObject(OAVObjectType type) Create a root object. A root object will not be automatically garbage collected when no references point to this object any longer. Creates an object identifier that can be used to store/retrieve attribute values. May reuse old object identifiers for performance.- Returns:
- An object identifier.
 
 - 
dropObjectvoid dropObject(java.lang.Object object) Drop an object from the state. Recursively removes the object and all connected objects that are not referenced elsewhere.- Parameters:
- object- The identifier of the object to remove.
 
 - 
addJavaRootObjectvoid addJavaRootObject(java.lang.Object object) Add a Java object as root object.- Parameters:
- object- The Java object.
 
 - 
removeJavaRootObjectvoid removeJavaRootObject(java.lang.Object object) Remove a Java object from root objects.- Parameters:
- object- The Java object.
 
 - 
containsObjectboolean containsObject(java.lang.Object object) Test if the state contains a specific object.- Parameters:
- object- The object identifier.
- Returns:
- True, if contained.
 
 - 
isIdentifierboolean isIdentifier(java.lang.Object object) Test if the object represents an identifier.- Parameters:
- object- The suspected object identifier.
- Returns:
- True, if object identifier.
 
 - 
getTypeOAVObjectType getType(java.lang.Object object) Get the type of an object.- Parameters:
- object- The object identifier.
 
 - 
getObjectsjava.util.Iterator getObjects() Get all objects in the state.
 - 
getDeepObjectsjava.util.Iterator getDeepObjects() Get all objects in the state and its substates.
 - 
getRootObjectsjava.util.Iterator getRootObjects() Get the root objects of the state.
 - 
getSizeint getSize() Get the number of objects in the state. Optional operation used for debugging only.
 - 
getUnreferencedObjectsjava.util.Collection getUnreferencedObjects() Get all unreferenced objects.- Returns:
- All unreferenced objects of the state.
 
 - 
findCyclejava.util.List findCycle(java.util.Collection objects) Find a cycle in a given set of objects.
 - 
getReferencingObjectsjava.util.Collection getReferencingObjects(java.lang.Object value) Get those objects referencing a given object.
 - 
addExternalObjectUsagevoid addExternalObjectUsage(java.lang.Object id, java.lang.Object external)Add an external usage of a state object. This prevents the oav object of being garbage collected as long as external references are present.- Parameters:
- id- The oav object id.
- external- The user object.
 
 - 
removeExternalObjectUsagevoid removeExternalObjectUsage(java.lang.Object id, java.lang.Object external)Remove an external usage of a state object. This allows the oav object of being garbage collected when no further external references and no internal references are present.- Parameters:
- id- The oav object id.
- external- The state external object.
 
 - 
getAttributeValuejava.lang.Object getAttributeValue(java.lang.Object object, OAVAttributeType attribute)Get an attribute value of an object.- Parameters:
- object- The identifier of the object.
- attribute- The attribute identifier.
- Returns:
- The value (basic, object id or java object).
 
 - 
setAttributeValuevoid setAttributeValue(java.lang.Object object, OAVAttributeType attribute, java.lang.Object value)Set an attribute of an object to the given value.- Parameters:
- object- The identifier of the object.
- attribute- The attribute identifier.
- value- The value (basic, object id or java object).
 
 - 
getAttributeValuesjava.util.Collection getAttributeValues(java.lang.Object object, OAVAttributeType attribute)Get the values of an attribute of an object.- Parameters:
- object- The identifier of the object.
- attribute- The attribute identifier.
- Returns:
- The values (basic, object ids or java objects).
 
 - 
getAttributeKeysjava.util.Collection getAttributeKeys(java.lang.Object object, OAVAttributeType attribute)Get the keys of an attribute of an object.- Parameters:
- object- The identifier of the object.
- attribute- The attribute identifier.
- Returns:
- The keys for which values are stored.
 
 - 
getAttributeValuejava.lang.Object getAttributeValue(java.lang.Object object, OAVAttributeType attribute, java.lang.Object key)Get an attribute value of an object. Method only applicable for map attribute type.- Parameters:
- object- The identifier of the object.
- attribute- The attribute identifier.
- key- The key.
- Returns:
- The value (basic, object id or java object).
 
 - 
containsKeyboolean containsKey(java.lang.Object object, OAVAttributeType attribute, java.lang.Object key)Test if a key is contained in the map attribute.- Parameters:
- object- The identifier of the object.
- attribute- The attribute identifier.
- key- The key.
- Returns:
- True if key is available.
 
 - 
addAttributeValuevoid addAttributeValue(java.lang.Object object, OAVAttributeType attribute, java.lang.Object value)Add an attribute of an object to the given value.- Parameters:
- object- The identifier of the object.
- attribute- The attribute identifier.
- value- The value (basic, object id or java object).
 
 - 
removeAttributeValuevoid removeAttributeValue(java.lang.Object object, OAVAttributeType attribute, java.lang.Object value)Remove an attribute of an object to the given value.- Parameters:
- object- The identifier of the object.
- attribute- The attribute identifier.
- value- The value (basic, object id or java object).
 
 - 
addStateListenervoid addStateListener(IOAVStateListener listener, boolean bunch) Add a new state listener.- Parameters:
- listener- The state listener.
- bunch- True, for adding a bunch listener.
 
 - 
removeStateListenervoid removeStateListener(IOAVStateListener listener) Remove a state listener.- Parameters:
- listener- The state listener.
 
 - 
notifyEventListenersvoid notifyEventListeners() Throw collected events and notify the listeners. Necessary if in event collecting mode.
 - 
expungeStaleObjectsvoid expungeStaleObjects() Expunge stale objects.
 - 
setSynchronizatorvoid setSynchronizator(ISynchronizator synchronizator) Set the synchronizator. The optional synchronizator is used to synchronize external modifications to the state (e.g. from bean changes). The synchronizator should only be set once, before the state is used.
 - 
getSynchronizatorISynchronizator getSynchronizator() Get the synchronizator (if any). The synchronizator (if available) can be used to synchronize access to the state with internal and external modifications.
 - 
getProfilerIProfiler getProfiler() Get the profiler.
 - 
setProfilervoid setProfiler(IProfiler profiler) Set the profiler.
 - 
addSubstatevoid addSubstate(IOAVState substate) Add a substate. Read accesses will be transparently mapped to substates. Write accesses to substates need not be supported and may generate UnsupportedOperationException. Also it can not be assumed that addition of substates will generate object added events.
 - 
getSubstatesIOAVState[] getSubstates() Get the substates.
 - 
isJavaIdentityboolean isJavaIdentity() Flag indicating that java objects are stored by identity instead of equality.
 - 
equalsboolean equals(java.lang.Object a, java.lang.Object b)Test if two values are equal according to current identity/equality settings.
 
- 
 
-