Class AbstractReferenceCounted

    • Constructor Detail

      • AbstractReferenceCounted

        public AbstractReferenceCounted()
    • Method Detail

      • refCnt

        public int refCnt()
        Description copied from interface: ReferenceCounted
        Returns the reference count of this object. If 0, it means this object has been deallocated.
        Specified by:
        refCnt in interface ReferenceCounted
      • setRefCnt

        protected final void setRefCnt​(int refCnt)
        An unsafe operation intended for use by a subclass that sets the reference count of the buffer directly
      • release

        public boolean release()
        Description copied from interface: ReferenceCounted
        Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
        Specified by:
        release in interface ReferenceCounted
        Returns:
        true if and only if the reference count became 0 and this object has been deallocated
      • release

        public boolean release​(int decrement)
        Description copied from interface: ReferenceCounted
        Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
        Specified by:
        release in interface ReferenceCounted
        Returns:
        true if and only if the reference count became 0 and this object has been deallocated
      • deallocate

        protected abstract void deallocate()
        Called once refCnt() is equals 0.