类 ReferenceCounted<T extends ReferenceCounted<T>>

  • 类型参数:
    T - the concrete implementation type

    public abstract class ReferenceCounted<T extends ReferenceCounted<T>>
    extends java.lang.Object
    Abstract class for reference counted resources.
    • 构造器概要

      构造器 
      限定符 构造器 说明
      protected ReferenceCounted()  
    • 方法概要

      所有方法 实例方法 抽象方法 具体方法 
      修饰符和类型 方法 说明
      protected abstract void destroy()
      Destroy the resource
      long refCount()
      Return current reference count
      boolean release()
      Release the resource, this method make reference count decrease by 1.
      boolean release​(int decrement)
      Release the resource, this method make reference count decrease by n.
      T retain()
      Retain the resource, this method make reference count increase by 1.
      T retain​(int increment)
      Retain the resource, this method make reference count increase by n.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • ReferenceCounted

        protected ReferenceCounted()
    • 方法详细资料

      • refCount

        public long refCount()
        Return current reference count
      • retain

        public T retain()
        Retain the resource, this method make reference count increase by 1.
        返回:
        self
      • retain

        public T retain​(int increment)
        Retain the resource, this method make reference count increase by n.
        返回:
        self
        抛出:
        java.lang.IllegalStateException - if already destroyed or reference count over flow.
      • release

        public boolean release()
        Release the resource, this method make reference count decrease by 1.
        返回:
        if destroyed
      • release

        public boolean release​(int decrement)
        Release the resource, this method make reference count decrease by n.
        返回:
        if destroyed
        抛出:
        java.lang.IllegalStateException - if already destroyed or reference count under flow.
      • destroy

        protected abstract void destroy()
        Destroy the resource