public class RefCount<T>
extends java.lang.Object
release() to do custom logic when reference counting hits 0.| Modifier and Type | Field and Description |
|---|---|
protected T |
object |
private java.util.concurrent.atomic.AtomicInteger |
refCount |
| Modifier and Type | Method and Description |
|---|---|
void |
decRef()
Decrements the reference counting of this object.
|
T |
get() |
int |
getRefCount()
Returns the current reference count.
|
void |
incRef()
Increments the reference count.
|
protected void |
release()
Called when reference counting hits 0.
|
private final java.util.concurrent.atomic.AtomicInteger refCount
protected final T object
public RefCount(T object)
protected void release()
throws java.io.IOException
java.io.IOExceptionpublic final void decRef()
throws java.io.IOException
release().java.io.IOExceptionpublic final T get()
public final int getRefCount()
public final void incRef()
decRef().