abstract class AbstractReferenceCounted extends java.lang.Object implements ReferenceCounted
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicInteger |
referenceCount |
Constructor and Description |
---|
AbstractReferenceCounted() |
Modifier and Type | Method and Description |
---|---|
int |
getCount()
Gets the current reference count, which starts at 0.
|
void |
release()
Release a reference to this object.
|
ReferenceCounted |
retain()
Retain an additional reference to this object.
|
public int getCount()
ReferenceCounted
getCount
in interface ReferenceCounted
public ReferenceCounted retain()
ReferenceCounted
retain
in interface ReferenceCounted
public void release()
ReferenceCounted
release
in interface ReferenceCounted