Class PyJavaInstance

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable

    public class PyJavaInstance
    extends PyInstance
    implements java.io.Externalizable
    A wrapper around a java instance.
    See Also:
    Serialized Form
    • Constructor Detail

      • PyJavaInstance

        public PyJavaInstance()
      • PyJavaInstance

        public PyJavaInstance​(PyJavaClass iclass)
      • PyJavaInstance

        public PyJavaInstance​(java.lang.Object proxy)
    • Method Detail

      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Implementation of the Externalizable interface.
        Specified by:
        readExternal in interface java.io.Externalizable
        Parameters:
        in - the input stream.
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Implementation of the Externalizable interface.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Parameters:
        out - the output stream.
        Throws:
        java.io.IOException
      • _is

        public PyObject _is​(PyObject o)
        Description copied from class: PyObject
        Implements is operator.
        Overrides:
        _is in class PyObject
        Parameters:
        o - the object to compare this with.
        Returns:
        the result of the comparison
      • _isnot

        public PyObject _isnot​(PyObject o)
        Description copied from class: PyObject
        Implements is not operator.
        Overrides:
        _isnot in class PyObject
        Parameters:
        o - the object to compare this with.
        Returns:
        the result of the comparison
      • __cmp__

        public int __cmp__​(PyObject o)
        Description copied from class: PyObject
        Equivalent to the standard Python __cmp__ method.
        Overrides:
        __cmp__ in class PyInstance
        Parameters:
        o - the object to compare this with.
        Returns:
        -1 if this < 0; 0 if this == o; +1 if this > o; -2 if no comparison is implemented
      • __str__

        public PyString __str__()
        Description copied from class: PyObject
        Equivalent to the standard Python __str__ method. This method should not typically need to be overridden. The easiest way to configure the string representation of a PyObject is to override the standard Java toString method.
        Overrides:
        __str__ in class PyInstance
      • __repr__

        public PyString __repr__()
        Description copied from class: PyObject
        Equivalent to the standard Python __repr__ method. This method should not typically need to be overrriden. The easiest way to configure the string representation of a PyObject is to override the standard Java toString method.
        Overrides:
        __repr__ in class PyInstance
      • __delattr__

        public void __delattr__​(java.lang.String attr)
        Description copied from class: PyObject
        A variant of the __delattr__ method which accepts a String as the key. This String must be interned. By default, this will call __delattr__(PyString name) with the appropriate args. The only reason to override this method is for performance.
        Overrides:
        __delattr__ in class PyInstance
        Parameters:
        attr - the name which will be removed - must be an interned string .
        See Also:
        PyObject.__delattr__(PyString)