|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.python.core.PyObject
org.python.core.PyInstance
public class PyInstance
A python class instance.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.python.core.PyObject |
|---|
PyObject.ConversionException |
| Field Summary | |
|---|---|
PyObject |
__dict__
The namespace of this instance. |
PyClass |
instclass
|
| Fields inherited from class org.python.core.PyObject |
|---|
TYPE |
| Constructor Summary | |
|---|---|
PyInstance()
|
|
PyInstance(PyClass iclass)
|
|
PyInstance(PyClass iclass,
PyObject dict)
Returns a new |
|
| Method Summary | |
|---|---|
PyObject |
__abs__()
Implements the __abs__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__add__(PyObject o)
Implements the __add__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__and__(PyObject o)
Implements the __and__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__call__(PyObject[] args,
java.lang.String[] keywords)
The basic method to override when implementing a callable object. |
int |
__cmp__(PyObject other)
Equivalent to the standard Python __cmp__ method. |
java.lang.Object |
__coerce_ex__(PyObject o)
Implements numeric coercion |
PyComplex |
__complex__()
Implements the __complex__ method by looking it up in the instance's dictionary and calling it if it is found. |
boolean |
__contains__(PyObject o)
Equivalent to the standard Python __contains__ method. |
void |
__delattr__(java.lang.String name)
A variant of the __delattr__ method which accepts a String as the key. |
void |
__delitem__(PyObject key)
Equivalent to the standard Python __delitem__ method. |
void |
__delslice__(PyObject start,
PyObject stop,
PyObject step)
|
PyObject |
__div__(PyObject o)
Implements the __div__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__divmod__(PyObject o)
Implements the __divmod__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__eq__(PyObject o)
Equivalent to the standard Python __eq__ method. |
PyObject |
__findattr__(java.lang.String name,
boolean stopAtJava)
|
PyObject |
__findattr_ex__(java.lang.String name)
Attribute lookup hook. |
PyObject |
__finditem__(int key)
A variant of the __finditem__ method which accepts a primitive int as the key. |
PyObject |
__finditem__(PyObject key)
Very similar to the standard Python __getitem__ method. |
PyFloat |
__float__()
Implements the __float__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__floordiv__(PyObject o)
Implements the __floordiv__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__ge__(PyObject o)
Equivalent to the standard Python __ge__ method. |
PyObject |
__getitem__(PyObject key)
Equivalent to the standard Python __getitem__ method. |
PyObject |
__getslice__(PyObject start,
PyObject stop,
PyObject step)
|
PyObject |
__gt__(PyObject o)
Equivalent to the standard Python __gt__ method. |
PyString |
__hex__()
Implements the __hex__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__iadd__(PyObject o)
Implements the __iadd__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__iand__(PyObject o)
Implements the __iand__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__idiv__(PyObject o)
Implements the __idiv__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__ifloordiv__(PyObject o)
Implements the __ifloordiv__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__ilshift__(PyObject o)
Implements the __ilshift__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__imod__(PyObject o)
Implements the __imod__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__imul__(PyObject o)
Implements the __imul__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__index__()
Implements the __index__ method by looking it up in the instance's dictionary and calling it if it is found. |
void |
__init__(PyObject[] args,
java.lang.String[] keywords)
|
PyObject |
__int__()
Implements the __int__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__invert__()
Implements the __invert__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__ior__(PyObject o)
Implements the __ior__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__ipow__(PyObject o)
Implements the __ipow__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__irshift__(PyObject o)
Implements the __irshift__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__isub__(PyObject o)
Implements the __isub__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__iter__()
Return an iterator that is used to iterate the element of this sequence. |
PyObject |
__iternext__()
Return the next element of the sequence that this is an iterator for. |
PyObject |
__itruediv__(PyObject o)
Implements the __itruediv__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__ixor__(PyObject o)
Implements the __ixor__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__jfindattr__(java.lang.String name)
|
PyObject |
__le__(PyObject o)
Equivalent to the standard Python __le__ method. |
int |
__len__()
Equivalent to the standard Python __len__ method. |
PyObject |
__long__()
Implements the __long__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__lshift__(PyObject o)
Implements the __lshift__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__lt__(PyObject o)
Equivalent to the standard Python __lt__ method. |
PyObject |
__mod__(PyObject o)
Implements the __mod__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__mul__(PyObject o)
Implements the __mul__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__ne__(PyObject o)
Equivalent to the standard Python __ne__ method. |
PyObject |
__neg__()
Implements the __neg__ method by looking it up in the instance's dictionary and calling it if it is found. |
boolean |
__nonzero__()
Equivalent to the standard Python __nonzero__ method. |
PyString |
__oct__()
Implements the __oct__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__or__(PyObject o)
Implements the __or__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__pos__()
Implements the __pos__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__pow__(PyObject o)
Implements the __pow__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__radd__(PyObject o)
Implements the __radd__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rand__(PyObject o)
Implements the __rand__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rdiv__(PyObject o)
Implements the __rdiv__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rdivmod__(PyObject o)
Implements the __rdivmod__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyString |
__repr__()
Equivalent to the standard Python __repr__ method. |
PyObject |
__rfloordiv__(PyObject o)
Implements the __rfloordiv__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rlshift__(PyObject o)
Implements the __rlshift__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rmod__(PyObject o)
Implements the __rmod__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rmul__(PyObject o)
Implements the __rmul__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__ror__(PyObject o)
Implements the __ror__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rpow__(PyObject o)
Implements the __rpow__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rrshift__(PyObject o)
Implements the __rrshift__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rshift__(PyObject o)
Implements the __rshift__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rsub__(PyObject o)
Implements the __rsub__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rtruediv__(PyObject o)
Implements the __rtruediv__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
__rxor__(PyObject o)
Implements the __rxor__ method by looking it up in the instance's dictionary and calling it if it is found. |
void |
__setattr__(java.lang.String name,
PyObject value)
A variant of the __setattr__ method which accepts a String as the key. |
void |
__setitem__(PyObject key,
PyObject value)
Equivalent to the standard Python __setitem__ method. |
void |
__setslice__(PyObject start,
PyObject stop,
PyObject step,
PyObject value)
|
PyString |
__str__()
Equivalent to the standard Python __str__ method. |
PyObject |
__sub__(PyObject o)
Implements the __sub__ method by looking it up in the instance's dictionary and calling it if it is found. |
java.lang.Object |
__tojava__(java.lang.Class c)
Equivalent to the Jython __tojava__ method. |
PyObject |
__truediv__(PyObject o)
Implements the __truediv__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyUnicode |
__unicode__()
|
PyObject |
__xor__(PyObject o)
Implements the __xor__ method by looking it up in the instance's dictionary and calling it if it is found. |
PyObject |
fastGetClass()
|
int |
hashCode()
|
PyObject |
invoke_ex(java.lang.String name)
|
PyObject |
invoke_ex(java.lang.String name,
PyObject arg1)
|
PyObject |
invoke_ex(java.lang.String name,
PyObject[] args,
java.lang.String[] keywords)
|
PyObject |
invoke_ex(java.lang.String name,
PyObject arg1,
PyObject arg2)
|
PyObject |
invoke(java.lang.String name)
Shortcut for calling a method on a PyObject with no args. |
PyObject |
invoke(java.lang.String name,
PyObject arg1)
Shortcut for calling a method on a PyObject with one arg. |
PyObject |
invoke(java.lang.String name,
PyObject arg1,
PyObject arg2)
Shortcut for calling a method on a PyObject with two args. |
boolean |
isCallable()
|
boolean |
isIndex()
Determine if this object can act as an index (implements __index__). |
void |
noAttributeError(java.lang.String name)
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public transient PyClass instclass
public PyObject __dict__
| Constructor Detail |
|---|
public PyInstance(PyClass iclass,
PyObject dict)
public PyInstance(PyClass iclass)
public PyInstance()
| Method Detail |
|---|
public PyObject fastGetClass()
fastGetClass in class PyObjectpublic java.lang.Object __tojava__(java.lang.Class c)
PyObjectPy.NoConversion
if this PyObject can not be converted to the
desired Java class.
__tojava__ in class PyObjectc - the Class to convert this PyObject to.
public void __init__(PyObject[] args,
java.lang.String[] keywords)
public PyObject __jfindattr__(java.lang.String name)
public PyObject __findattr_ex__(java.lang.String name)
PyObjectPyObject.__getattr__(String) or
PyObject.__findattr__(String). Both methods have a clear policy for
failed lookups.
__findattr_ex__ in class PyObject
public PyObject __findattr__(java.lang.String name,
boolean stopAtJava)
public boolean isCallable()
isCallable in class PyObjectpublic boolean isIndex()
PyObject
isIndex in class PyObjectpublic PyObject invoke(java.lang.String name)
PyObject
invoke in class PyObjectname - the name of the method to call. This must be an
interned string!
public PyObject invoke(java.lang.String name,
PyObject arg1)
PyObject
invoke in class PyObjectname - the name of the method to call. This must be an
interned string!arg1 - the one argument of the method.
public PyObject invoke(java.lang.String name,
PyObject arg1,
PyObject arg2)
PyObject
invoke in class PyObjectname - the name of the method to call. This must be an
interned string!arg1 - the first argument of the method.arg2 - the second argument of the method.
public void noAttributeError(java.lang.String name)
noAttributeError in class PyObject
public void __setattr__(java.lang.String name,
PyObject value)
PyObject
__setattr__ in class PyObjectname - the name whose value will be set -
must be an interned string .value - the value to set this name toPyObject.__setattr__(PyString, PyObject)public void __delattr__(java.lang.String name)
PyObject__delattr__(PyString name)
with the appropriate args.
The only reason to override this method is for performance.
__delattr__ in class PyObjectname - the name which will be removed -
must be an interned string .PyObject.__delattr__(PyString)
public PyObject invoke_ex(java.lang.String name,
PyObject[] args,
java.lang.String[] keywords)
public PyObject invoke_ex(java.lang.String name)
public PyObject invoke_ex(java.lang.String name,
PyObject arg1)
public PyObject invoke_ex(java.lang.String name,
PyObject arg1,
PyObject arg2)
public PyObject __call__(PyObject[] args,
java.lang.String[] keywords)
PyObject
__call__ in class PyObjectargs - all arguments to the function (including
keyword arguments).keywords - the keywords used for all keyword arguments.public PyString __repr__()
PyObjectPyObject is to
override the standard Java toString method.
__repr__ in class PyObjectpublic PyString __str__()
PyObjectPyObject is to
override the standard Java toString method.
__str__ in class PyObjectpublic PyUnicode __unicode__()
__unicode__ in class PyObjectpublic int hashCode()
hashCode in class PyObjectpublic int __cmp__(PyObject other)
PyObject
__cmp__ in class PyObjectother - the object to compare this with.
public PyObject __lt__(PyObject o)
PyObject
__lt__ in class PyObjecto - the object to compare this with.
public PyObject __le__(PyObject o)
PyObject
__le__ in class PyObjecto - the object to compare this with.
public PyObject __gt__(PyObject o)
PyObject
__gt__ in class PyObjecto - the object to compare this with.
public PyObject __ge__(PyObject o)
PyObject
__ge__ in class PyObjecto - the object to compare this with.
public PyObject __eq__(PyObject o)
PyObject
__eq__ in class PyObjecto - the object to compare this with.
public PyObject __ne__(PyObject o)
PyObject
__ne__ in class PyObjecto - the object to compare this with.
public boolean __nonzero__()
PyObjectPyObject is considered true.
__nonzero__ in class PyObjectpublic int __len__()
PyObject
__len__ in class PyObjectpublic PyObject __finditem__(int key)
PyObjectint as the key. By default, this method will call
__finditem__(PyObject key) with the appropriate args.
The only reason to override this method is for performance.
__finditem__ in class PyObjectkey - the key to lookup in this sequence.
PyObject.__finditem__(PyObject)public PyObject __finditem__(PyObject key)
PyObject
__finditem__ in class PyObjectkey - the key to lookup in this container
public PyObject __getitem__(PyObject key)
PyObject__finditem__ method instead.
__getitem__ in class PyObjectkey - the key to lookup in this container.
PyObject.__finditem__(PyObject)
public void __setitem__(PyObject key,
PyObject value)
PyObject
__setitem__ in class PyObjectkey - the key whose value will be setvalue - the value to set this key topublic void __delitem__(PyObject key)
PyObject
__delitem__ in class PyObjectkey - the key to be removed from the container
public PyObject __getslice__(PyObject start,
PyObject stop,
PyObject step)
__getslice__ in class PyObject
public void __setslice__(PyObject start,
PyObject stop,
PyObject step,
PyObject value)
__setslice__ in class PyObject
public void __delslice__(PyObject start,
PyObject stop,
PyObject step)
__delslice__ in class PyObjectpublic PyObject __iter__()
PyObjectIf a PyObject subclass should support iteration based in the __finditem__() method, it must supply an implementation of __iter__() like this:
public PyObject __iter__() {
return new PySequenceIter(this);
}
When iterating over a python sequence from java code, it should be done with code like this:
for (PyObject item : seq.asIterable()) {
// Do somting with item
}
__iter__ in class PyObjectpublic PyObject __iternext__()
PyObject
__iternext__ in class PyObjectpublic boolean __contains__(PyObject o)
PyObject
__contains__ in class PyObjecto - the element to search for in this container.
public java.lang.Object __coerce_ex__(PyObject o)
PyObject
__coerce_ex__ in class PyObjecto - the other object involved in the coercion
public PyObject __index__()
__index__ in class PyObjectpublic PyString __hex__()
__hex__ in class PyObjectpublic PyString __oct__()
__oct__ in class PyObjectpublic PyObject __int__()
__int__ in class PyObjectpublic PyFloat __float__()
__float__ in class PyObjectpublic PyObject __long__()
__long__ in class PyObjectpublic PyComplex __complex__()
__complex__ in class PyObjectpublic PyObject __pos__()
__pos__ in class PyObjectpublic PyObject __neg__()
__neg__ in class PyObjectpublic PyObject __abs__()
__abs__ in class PyObjectpublic PyObject __invert__()
__invert__ in class PyObjectpublic PyObject __add__(PyObject o)
__add__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __radd__(PyObject o)
__radd__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __iadd__(PyObject o)
__iadd__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __sub__(PyObject o)
__sub__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rsub__(PyObject o)
__rsub__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __isub__(PyObject o)
__isub__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __mul__(PyObject o)
__mul__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rmul__(PyObject o)
__rmul__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __imul__(PyObject o)
__imul__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __div__(PyObject o)
__div__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rdiv__(PyObject o)
__rdiv__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __idiv__(PyObject o)
__idiv__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __floordiv__(PyObject o)
__floordiv__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rfloordiv__(PyObject o)
__rfloordiv__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __ifloordiv__(PyObject o)
__ifloordiv__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __truediv__(PyObject o)
__truediv__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rtruediv__(PyObject o)
__rtruediv__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __itruediv__(PyObject o)
__itruediv__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __mod__(PyObject o)
__mod__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rmod__(PyObject o)
__rmod__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __imod__(PyObject o)
__imod__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __divmod__(PyObject o)
__divmod__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rdivmod__(PyObject o)
__rdivmod__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __pow__(PyObject o)
__pow__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rpow__(PyObject o)
__rpow__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __ipow__(PyObject o)
__ipow__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __lshift__(PyObject o)
__lshift__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rlshift__(PyObject o)
__rlshift__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __ilshift__(PyObject o)
__ilshift__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rshift__(PyObject o)
__rshift__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rrshift__(PyObject o)
__rrshift__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __irshift__(PyObject o)
__irshift__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __and__(PyObject o)
__and__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rand__(PyObject o)
__rand__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __iand__(PyObject o)
__iand__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __or__(PyObject o)
__or__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __ror__(PyObject o)
__ror__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __ior__(PyObject o)
__ior__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __xor__(PyObject o)
__xor__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
public PyObject __rxor__(PyObject o)
__rxor__ in class PyObjecto - the object to perform this binary operation with
(the left-hand operand).
public PyObject __ixor__(PyObject o)
__ixor__ in class PyObjecto - the object to perform this binary operation with
(the right-hand operand).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||