📄 pyinstance.java
字号:
PyObject ret = invoke("__int__"); if (ret instanceof PyInteger) return (PyInteger)ret; throw Py.TypeError("__int__() should return a int"); } /** * Implements the __float__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyFloat __float__() { PyObject ret = invoke("__float__"); if (ret instanceof PyFloat) return (PyFloat)ret; throw Py.TypeError("__float__() should return a float"); } /** * Implements the __long__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyLong __long__() { PyObject ret = invoke("__long__"); if (ret instanceof PyLong) return (PyLong)ret; throw Py.TypeError("__long__() should return a long"); } /** * Implements the __complex__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyComplex __complex__() { PyObject ret = invoke("__complex__"); if (ret instanceof PyComplex) return (PyComplex)ret; throw Py.TypeError("__complex__() should return a complex"); } /** * Implements the __pos__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __pos__() { return invoke("__pos__"); } /** * Implements the __neg__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __neg__() { return invoke("__neg__"); } /** * Implements the __abs__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __abs__() { return invoke("__abs__"); } /** * Implements the __invert__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __invert__() { return invoke("__invert__"); } // Binary ops /** * Implements the __add__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __add__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__add__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__add__", o2); else return o1._add(o2); } } /** * Implements the __radd__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __radd__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__radd__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__radd__", o2); else return o2._add(o1); } } /** * Implements the __iadd__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __iadd__(PyObject o) { PyObject ret = invoke_ex("__iadd__", o); if (ret != null) return ret; return super.__iadd__(o); } /** * Implements the __sub__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __sub__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__sub__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__sub__", o2); else return o1._sub(o2); } } /** * Implements the __rsub__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __rsub__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__rsub__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__rsub__", o2); else return o2._sub(o1); } } /** * Implements the __isub__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __isub__(PyObject o) { PyObject ret = invoke_ex("__isub__", o); if (ret != null) return ret; return super.__isub__(o); } /** * Implements the __mul__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __mul__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__mul__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__mul__", o2); else return o1._mul(o2); } } /** * Implements the __rmul__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __rmul__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__rmul__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__rmul__", o2); else return o2._mul(o1); } } /** * Implements the __imul__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __imul__(PyObject o) { PyObject ret = invoke_ex("__imul__", o); if (ret != null) return ret; return super.__imul__(o); } /** * Implements the __div__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __div__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__div__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__div__", o2); else return o1._div(o2); } } /** * Implements the __rdiv__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __rdiv__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__rdiv__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__rdiv__", o2); else return o2._div(o1); } } /** * Implements the __idiv__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __idiv__(PyObject o) { PyObject ret = invoke_ex("__idiv__", o); if (ret != null) return ret; return super.__idiv__(o); } /** * Implements the __floordiv__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __floordiv__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__floordiv__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__floordiv__", o2); else return o1._floordiv(o2); } } /** * Implements the __rfloordiv__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __rfloordiv__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__rfloordiv__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__rfloordiv__", o2); else return o2._floordiv(o1); } } /** * Implements the __ifloordiv__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __ifloordiv__(PyObject o) { PyObject ret = invoke_ex("__ifloordiv__", o); if (ret != null) return ret; return super.__ifloordiv__(o); } /** * Implements the __truediv__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __truediv__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__truediv__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__truediv__", o2); else return o1._truediv(o2); } } /** * Implements the __rtruediv__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __rtruediv__(PyObject o) { Object ctmp = __coerce_ex__(o); if (ctmp == null || ctmp == Py.None) return invoke_ex("__rtruediv__", o); else { PyObject o1 = ((PyObject[])ctmp)[0]; PyObject o2 = ((PyObject[])ctmp)[1]; if (this == o1) // Prevent recusion if __coerce__ return self return invoke_ex("__rtruediv__", o2); else return o2._truediv(o1); } } /** * Implements the __itruediv__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __itruediv__(PyObject o) { PyObject ret = invoke_ex("__itruediv__", o); if (ret != null) return ret; return super.__itruediv__(o); } /** * Implements the __mod__ method by looking it up * in the instance's dictionary and calling it if it is found. **/ public PyObject __mod__(PyObject o) { Object ctmp = __coerce_ex__(o);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -