Class AbstractReferenceCountable

    • Constructor Detail

      • AbstractReferenceCountable

        public AbstractReferenceCountable()
    • Method Detail

      • disposeIfUnreferenced

        public boolean disposeIfUnreferenced()
        Description copied from interface: ReferenceCountable
        Dispose this instance if there are no more references to it.
        Specified by:
        disposeIfUnreferenced in interface ReferenceCountable
        Returns:
        whether this instance is not referenced any more
      • disposeUnreferenced

        protected abstract void disposeUnreferenced()
        Dispose this instance, which is not referenced anymore. This method should always be invoked through disposeUnreferenced()
      • noteDiscardedReference

        public void noteDiscardedReference​(boolean isDisposeIfUnreferenced)
        Description copied from interface: ReferenceCountable
        Declare that a reference on this instance has been discarded. Optionally, dispose this instance if there are no remaining references.
        Specified by:
        noteDiscardedReference in interface ReferenceCountable
        Parameters:
        isDisposeIfUnreferenced - whether to dispose this instance if there are no more references
      • isDisposed

        public boolean isDisposed()
        Description copied from interface: ReferenceCountable
        Optional operation. Tell whether this instance has been disposed.
        Specified by:
        isDisposed in interface ReferenceCountable
        Returns:
        whether this instance has been disposed