public final class Ref<T> extends java.lang.Object implements RefCounted<T>, java.lang.AutoCloseable
RefCounted.Tidy
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG_ENABLED |
Constructor and Description |
---|
Ref(T referent,
RefCounted.Tidy tidy) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
ensureReleased() |
T |
get() |
int |
globalCount()
A convenience method for reporting:
|
java.lang.String |
printDebugInfo() |
Ref<T> |
ref() |
void |
release()
Must be called exactly once, when the logical operation for which this Ref was created has terminated.
|
Ref<T> |
tryRef() |
public Ref(T referent, RefCounted.Tidy tidy)
public void release()
public void ensureReleased()
public void close()
close
in interface java.lang.AutoCloseable
public T get()
public Ref<T> tryRef()
tryRef
in interface RefCounted<T>
public Ref<T> ref()
ref
in interface RefCounted<T>
public java.lang.String printDebugInfo()
public int globalCount()
Copyright © 2016 The Apache Software Foundation