Class ReferenceCounted<T>

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class ReferenceCounted<T>
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Constructor Summary

      Constructors 
      Constructor Description
      ReferenceCounted​(T object, java.util.function.Consumer<T> deleter)  
    • Constructor Detail

      • ReferenceCounted

        public ReferenceCounted​(T object,
                                java.util.function.Consumer<T> deleter)
    • Method Detail

      • get

        public T get()
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • retain

        public void retain()
      • release

        public void release()
      • getReferenceCount

        public int getReferenceCount()