Class ProvidedObjectImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void deleteObject()
      Signals the provided object to delete itself.
      boolean equals​(java.lang.Object o)  
      void futureReady​(ProMFuture<? extends java.lang.Object> future)  
      ProvidedObjectID getID()
      Returns the ID of this Provided Object
      java.lang.String getLabel()
      Returns the label of this provided object
      java.lang.Object getObject()
      Same as calling getObject(true);
      java.lang.Object getObject​(boolean waitIfFuture)
      Returns the object stored in this provided object.
      java.lang.Class<? extends java.lang.Object> getType()
      Returns the type of the object contained in this Provided Object.
      int hashCode()  
      boolean isDeleted()
      Returns whether or not this object has been deleted.
      void nameChanged​(java.lang.String newName)  
      void pluginCancelled​(PluginContext context)  
      void setLabel​(java.lang.String label)
      Sets the label of this provided object to the new label.
      void setObject​(java.lang.Object newObject)
      Changes the content of this provided object by replacing the original object with the new object.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ProvidedObjectImpl

        public ProvidedObjectImpl​(java.lang.String label,
                                  ProvidedObjectID id,
                                  T object,
                                  java.lang.Class<? super T> type,
                                  ProvidedObjectManager manager)
                           throws java.lang.NullPointerException
        Throws:
        java.lang.NullPointerException
    • Method Detail

      • deleteObject

        public void deleteObject()
        Description copied from interface: ProvidedObject
        Signals the provided object to delete itself. After calling this method, isDeleted() will return true and where applicable, ProvidedObjectDeletedExceptions will be thrown.
        Specified by:
        deleteObject in interface ProvidedObject
      • getObject

        public java.lang.Object getObject​(boolean waitIfFuture)
                                   throws ProvidedObjectDeletedException
        Description copied from interface: ProvidedObject
        Returns the object stored in this provided object. If the object is not an instance of ProMFuture, then the object itself is returned. Otherwise, it depends on the parameter whether the ProMFuture is returned, or the calling thread is blocked until the future finished (or is cancelled)
        Specified by:
        getObject in interface ProvidedObject
        Parameters:
        waitIfFuture - if set to false, the returned object might be an instance of ProMFuture. Otherwise not.
        Returns:
        Throws:
        ProvidedObjectDeletedException - If the object was removed from memory because there were no useful references to it anymore
      • setObject

        public void setObject​(java.lang.Object newObject)
                       throws ProvidedObjectDeletedException
        Description copied from interface: ProvidedObject
        Changes the content of this provided object by replacing the original object with the new object. This can only be done if the current object has not been deleted yet.
        Specified by:
        setObject in interface ProvidedObject
        Throws:
        ProvidedObjectDeletedException - If the object was removed from memory because there were no useful references to it anymore
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getLabel

        public java.lang.String getLabel()
        Description copied from interface: ProvidedObject
        Returns the label of this provided object
        Specified by:
        getLabel in interface ProvidedObject
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • pluginCancelled

        public void pluginCancelled​(PluginContext context)
      • isDeleted

        public boolean isDeleted()
        Description copied from interface: ProvidedObject
        Returns whether or not this object has been deleted. Note that if this method returns false, no ProvidedObjectDeletedExceptions are thrown in subsequent, synchronized calls to this provided object.
        Specified by:
        isDeleted in interface ProvidedObject
        Returns:
      • getType

        public java.lang.Class<? extends java.lang.Object> getType()
                                                            throws ProvidedObjectDeletedException
        Description copied from interface: ProvidedObject
        Returns the type of the object contained in this Provided Object. If the internal object is a ProMFuture, then the result type of the future is returned, i.e. ProMFuture.class is never returned by this method.
        Specified by:
        getType in interface ProvidedObject
        Returns:
        Throws:
        ProvidedObjectDeletedException - If the object was removed from memory because there were no useful references to it anymore