Class AbstractReference

java.lang.Object
org.python.core.PyObject
org.python.modules._weakref.AbstractReference
All Implemented Interfaces:
Serializable, Traverseproc
Direct Known Subclasses:
ProxyType, ReferenceType

public abstract class AbstractReference extends PyObject implements Traverseproc
Base class for weakref types.
See Also:
  • Constructor Details

  • Method Details

    • equals

      public boolean equals(Object ob_other)
      Description copied from class: PyObject
      Should almost never be overridden. If overridden, it is the subclasses responsibility to ensure that a.equals(b) == true iff cmp(a,b) == 0
      Overrides:
      equals in class PyObject
    • hasCallback

      public boolean hasCallback()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class PyObject
    • __eq__

      public PyObject __eq__(PyObject other)
      Description copied from class: PyObject
      Equivalent to the standard Python __eq__ method.
      Overrides:
      __eq__ in class PyObject
      Parameters:
      other - the object to compare this with.
      Returns:
      the result of the comparison.
    • __ne__

      public PyObject __ne__(PyObject other)
      Description copied from class: PyObject
      Equivalent to the standard Python __ne__ method.
      Overrides:
      __ne__ in class PyObject
      Parameters:
      other - the object to compare this with.
      Returns:
      the result of the comparison.
    • traverse

      public int traverse(Visitproc visit, Object arg)
      Description copied from interface: Traverseproc
      Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc.visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc.visit(PyObject, Object) must not be called with a null PyObject-argument.
      Specified by:
      traverse in interface Traverseproc
    • refersDirectlyTo

      public boolean refersDirectlyTo(PyObject ob)
      Description copied from interface: Traverseproc
      Optional operation. Should only be implemented if it is more efficient than calling Traverseproc.traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.
      Specified by:
      refersDirectlyTo in interface Traverseproc