Class OAVState

  • All Implemented Interfaces:
    IOAVState

    public class OAVState
    extends OAVAbstractState
    An object holding the state as OAV triples (object, attribute, value).
    • Field Detail

      • objects

        protected java.util.Map objects
        The objects table (oid -> content map).
      • externalusages

        protected java.util.Map externalusages
        Writing (and therefore resurrecting) is not supported.
    • Constructor Detail

      • OAVState

        public OAVState​(OAVTypeModel tmodel)
        Create a new empty OAV state representation.
    • Method Detail

      • addExternalObjectUsage

        public void addExternalObjectUsage​(java.lang.Object id,
                                           java.lang.Object external)
        Add an external usage of a state object (oid). This prevents the oav object of being garbage collected as long as external references are present.
        Specified by:
        addExternalObjectUsage in interface IOAVState
        Specified by:
        addExternalObjectUsage in class OAVAbstractState
        Parameters:
        id - The oav object id.
        external - The user object.
      • removeExternalObjectUsage

        public void removeExternalObjectUsage​(java.lang.Object id,
                                              java.lang.Object external)
        Remove an external usage of a state object (oid). This allows the oav object of being garbage collected when no further external references and no internal references are present.
        Specified by:
        removeExternalObjectUsage in interface IOAVState
        Specified by:
        removeExternalObjectUsage in class OAVAbstractState
        Parameters:
        id - The oav object id.
        external - The state external object.
      • isExternallyUsed

        protected boolean isExternallyUsed​(java.lang.Object id)
        Test if an object is externally used.
        Specified by:
        isExternallyUsed in class OAVAbstractState
        Parameters:
        id - The id.
        Returns:
        True, if externally used.
      • internalCreateObject

        protected java.util.Map internalCreateObject​(java.lang.Object id)
        Internally create an object.
        Specified by:
        internalCreateObject in class OAVAbstractState
        Parameters:
        id - The id.
        Returns:
        The content map of the new object.
      • internalRemoveObject

        protected java.util.Map internalRemoveObject​(java.lang.Object id)
        Remove an object from the state objects.
        Specified by:
        internalRemoveObject in class OAVAbstractState
        Parameters:
        id - The id.
        Returns:
        The content map of the object.
      • internalGetObjectContent

        protected java.util.Map internalGetObjectContent​(java.lang.Object id)
        Get the object content of an object.
        Specified by:
        internalGetObjectContent in class OAVAbstractState
        Parameters:
        id - The id.
        Returns:
        The content map of the object.
      • internalContainsObject

        protected boolean internalContainsObject​(java.lang.Object id)
        Test if an object is contained in the state.
        Specified by:
        internalContainsObject in class OAVAbstractState
        Parameters:
        id - The id.
        Returns:
        True, if object is contained.
      • internalObjectsSize

        protected int internalObjectsSize()
        Test how many object are contained in the state.
        Specified by:
        internalObjectsSize in class OAVAbstractState
        Returns:
        The number of objects.
      • internalGetObjects

        protected java.util.Set internalGetObjects()
        Get a set of the internal state objects.
        Specified by:
        internalGetObjects in class OAVAbstractState
        Returns:
        A set of the state objects.