public class GlobalRef extends WeakReference<PyObject>
| Modifier and Type | Method and Description |
|---|---|
void |
add(AbstractReference ref) |
int |
count() |
boolean |
equals(Object o)
Allow
GlobalRefs to be used as hashtable-keys. |
static int |
getCount(PyObject object)
Return the number of references to the specified
PyObject. |
static PyList |
getRefs(PyObject object)
Return a list of references to the specified
PyObject. |
static boolean |
hasDelayedCallbacks() |
int |
hashCode()
Allows
GlobalRef to be used as hashtable-keys. |
static GlobalRef |
newInstance(PyObject object)
Create a new tracked
GlobalRef. |
static void |
processDelayedCallbacks()
Call all callbacks that were enqueued via
delayedCallback(GlobalRef) method. |
int |
pythonHashCode()
The publicly used
hashCode, for the
{@link org.python.modules. |
PyList |
refs() |
void |
restore(PyObject formerReferent)
Restores this weak reference to its former referent.
|
clear, enqueue, get, isEnqueuedpublic GlobalRef(PyObject object)
public void add(AbstractReference ref)
public static void processDelayedCallbacks()
delayedCallback(GlobalRef) method.delayedCallback(GlobalRef)public static boolean hasDelayedCallbacks()
public int count()
public PyList refs()
public static GlobalRef newInstance(PyObject object)
GlobalRef.object - a PyObject to referenceGlobalRefpublic void restore(PyObject formerReferent)
GlobalRef is created
and inserted into all adjacent
AbstractReferences. The
current GlobalRef is disbanded.
If the given PyObject is not the former
referent of this weak reference, an
IllegalArgumentException is thrown.IllegalArgumentException - if formerReferent is not
the actual former referent.public static int getCount(PyObject object)
PyObject.object - a PyObjectpublic static PyList getRefs(PyObject object)
PyObject.public boolean equals(Object o)
GlobalRefs to be used as hashtable-keys.public int hashCode()
GlobalRef to be used as hashtable-keys.public int pythonHashCode()
hashCode, for the
AbstractReference
wrapper.int-value