Manages a linked list of general purpose Object-attributes that
can be attached to arbitrary org.s.
This method replaces the formerly used method of maintaining weak
hash-maps (java.) for such cases.
These weak hash-maps were used to map
PyObjects to such attributes, for instance
to attach
org.-objects in the
org..
Attributes attached via the weak hash-map-method break, if the
PyObject is resurrected in its finalizer. The
JyAttribute-method is resurrection-safe.
To reduce memory footprint of PyObjects, the fields for
org.s and
javaProxy are included in the list; javaProxy always
on top so there is no speed-regression,
org. on bottom,
as it is usually never accessed.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv byte | |
| public static final byte | |
| public static final byte | GC_CYCLE_MARK_ATTR
Used by |
| public static final byte | GC_DELAYED_FINALIZE_CRITICAL_MARK_ATTR
Used by |
| public static final byte | |
| public static final byte | JYNI_HANDLE_ATTR
Reserved for use by JyNI. |
| private static byte | |
| private static byte | |
| public static final byte | PY_ID_ATTR
Allows the id of a |
| public static final byte | PYCLASS_PY2JY_CACHE_ATTR
Only used internally by |
| public static final byte | WEAK_REF_ATTR
Stores list of weak references linking to this |
| public static final byte | WEAKREF_PENDING_GET_ATTR
Holds the current thread for an
|
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static void | debugPrintAttributes(PyObject o, PrintStream out)
Prints the current state of the attribute-list of the given object to the given stream. |
| public static void | |
| public static Object | getAttr(PyObject ob, byte attr_type)
Retrieves the attribute of the given type from the given
|
| protected abstract JyAttribute | |
| protected abstract Object | |
| public static boolean | hasAttr(PyObject ob, byte attr_type)
Checks whether the given |
| public static byte | Returns: a non-transient attr type for custom useReserves and returns a new non-transient attr type for custom use. |
| public static byte | Returns: a transient attr type for custom useReserves and returns a new transient attr type for custom use. |
| public static void | |
| protected abstract void | |
| protected abstract void |
| attr_type | back to summary |
|---|---|
| pack-priv byte attr_type | |
| FINALIZE_TRIGGER_ATTR | back to summary |
|---|---|
| public static final byte FINALIZE_TRIGGER_ATTR | |
| GC_CYCLE_MARK_ATTR | back to summary |
|---|---|
| public static final byte GC_CYCLE_MARK_ATTR Used by | |
| GC_DELAYED_FINALIZE_CRITICAL_MARK_ATTR | back to summary |
|---|---|
| public static final byte GC_DELAYED_FINALIZE_CRITICAL_MARK_ATTR Used by | |
| JAVA_PROXY_ATTR | back to summary |
|---|---|
| public static final byte JAVA_PROXY_ATTR | |
| JYNI_HANDLE_ATTR | back to summary |
|---|---|
| public static final byte JYNI_HANDLE_ATTR Reserved for use by JyNI. | |
| nonBuiltinAttrTypeOffset | back to summary |
|---|---|
| private static byte nonBuiltinAttrTypeOffset | |
| nonBuiltinTransientAttrTypeOffset | back to summary |
|---|---|
| private static byte nonBuiltinTransientAttrTypeOffset | |
| PY_ID_ATTR | back to summary |
|---|---|
| public static final byte PY_ID_ATTR Allows the id of a | |
| PYCLASS_PY2JY_CACHE_ATTR | back to summary |
|---|---|
| public static final byte PYCLASS_PY2JY_CACHE_ATTR Only used internally by | |
| WEAK_REF_ATTR | back to summary |
|---|---|
| public static final byte WEAK_REF_ATTR Stores list of weak references linking to this | |
| WEAKREF_PENDING_GET_ATTR | back to summary |
|---|---|
| public static final byte WEAKREF_PENDING_GET_ATTR Holds the current thread for an
| |
| JyAttribute | back to summary |
|---|---|
| protected JyAttribute(byte attr_type) | |
| debugPrintAttributes | back to summary |
|---|---|
| public static void debugPrintAttributes(PyObject o, PrintStream out) Prints the current state of the attribute-list of the given object to the given stream. (Intended for debugging) | |
| delAttr | back to summary |
|---|---|
| public static void delAttr(PyObject ob, byte attr_type) Removes the attribute of given type from the given object's attribute-list
(if it existed at all). This is equivalent to calling
| |
| getAttr | back to summary |
|---|---|
| public static Object getAttr(PyObject ob, byte attr_type) Retrieves the attribute of the given type from the given
| |
| getNext | back to summary |
|---|---|
| protected abstract JyAttribute getNext() | |
| getValue | back to summary |
|---|---|
| protected abstract Object getValue() | |
| hasAttr | back to summary |
|---|---|
| public static boolean hasAttr(PyObject ob, byte attr_type) Checks whether the given | |
| reserveCustomAttrType | back to summary |
|---|---|
| public static byte reserveCustomAttrType() Reserves and returns a new non-transient attr type for custom use.
| |
| reserveTransientCustomAttrType | back to summary |
|---|---|
| public static byte reserveTransientCustomAttrType() Reserves and returns a new transient attr type for custom use.
| |
| setAttr | back to summary |
|---|---|
| public static void setAttr(PyObject ob, byte attr_type, Object value) Sets the attribute of type | |
| setNext | back to summary |
|---|---|
| protected abstract void setNext(JyAttribute next) | |
| setValue | back to summary |
|---|---|
| protected abstract void setValue(Object value) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv JyAttribute | |
| pack-priv Object |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected JyAttribute | |
| protected Object | |
| protected void | |
| protected void |
| next | back to summary |
|---|---|
| pack-priv JyAttribute next | |
| value | back to summary |
|---|---|
| pack-priv Object value | |
| AttributeLink | back to summary |
|---|---|
| protected AttributeLink(byte attr_type, Object value) | |
| getNext | back to summary |
|---|---|
| protected JyAttribute getNext() Implements abstract org.
| |
| getValue | back to summary |
|---|---|
| protected Object getValue() Implements abstract org.
| |
| setNext | back to summary |
|---|---|
| protected void setNext(JyAttribute next) Implements abstract org.
| |
| setValue | back to summary |
|---|---|
| protected void setValue(Object value) Implements abstract org.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv transient JyAttribute | |
| pack-priv transient Object |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected JyAttribute | |
| protected Object | |
| protected void | |
| protected void |
| next | back to summary |
|---|---|
| pack-priv transient JyAttribute next | |
| value | back to summary |
|---|---|
| pack-priv transient Object value | |
| TransientAttributeLink | back to summary |
|---|---|
| protected TransientAttributeLink(byte attr_type, Object value) | |
| getNext | back to summary |
|---|---|
| protected JyAttribute getNext() Implements abstract org.
| |
| getValue | back to summary |
|---|---|
| protected Object getValue() Implements abstract org.
| |
| setNext | back to summary |
|---|---|
| protected void setNext(JyAttribute next) Implements abstract org.
| |
| setValue | back to summary |
|---|---|
| protected void setValue(Object value) Implements abstract org.
| |