|
|||||||||
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.PyLong
public class PyLong
A builtin python long. This is implemented as a java.math.BigInteger.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.python.core.PyObject |
---|
PyObject.ConversionException |
Field Summary | |
---|---|
static BigInteger |
MAX_LONG
|
static BigInteger |
MAX_ULONG
|
static BigInteger |
maxLong
Deprecated. Use MAX_INT instead. |
static BigInteger |
maxULong
Deprecated. Use MAX_ULONG instead. |
static BigInteger |
MIN_LONG
|
static BigInteger |
minLong
Deprecated. Use MIN_INT instead. |
static PyType |
TYPE
|
Constructor Summary | |
---|---|
PyLong(BigInteger v)
|
|
PyLong(double v)
|
|
PyLong(long v)
|
|
PyLong(PyType subType,
BigInteger v)
|
|
PyLong(String s)
|
Method Summary | |
---|---|
PyObject |
__abs__()
Equivalent to the standard Python __abs__ method. |
PyObject |
__add__(PyObject right)
Equivalent to the standard Python __add__ method |
PyObject |
__and__(PyObject right)
Equivalent to the standard Python __and__ method |
int |
__cmp__(PyObject other)
Equivalent to the standard Python __cmp__ method. |
Object |
__coerce_ex__(PyObject other)
Implements numeric coercion |
PyComplex |
__complex__()
Equivalent to the standard Python __complex__ method. |
PyObject |
__div__(PyObject right)
Equivalent to the standard Python __div__ method |
PyObject |
__divmod__(PyObject right)
Equivalent to the standard Python __divmod__ method |
PyFloat |
__float__()
Equivalent to the standard Python __float__ method. |
PyObject |
__floordiv__(PyObject right)
Equivalent to the standard Python __floordiv__ method |
PyTuple |
__getnewargs__()
|
PyString |
__hex__()
Equivalent to the standard Python __hex__ method Should only be overridden by numeric objects that can be reasonably represented as a hexadecimal string. |
PyObject |
__index__()
Equivalent to the standard Python __index__ method. |
PyObject |
__int__()
Equivalent to the standard Python __int__ method. |
PyObject |
__invert__()
Equivalent to the standard Python __invert__ method. |
PyObject |
__long__()
Equivalent to the standard Python __long__ method. |
PyObject |
__lshift__(PyObject right)
Equivalent to the standard Python __lshift__ method |
PyObject |
__mod__(PyObject right)
Equivalent to the standard Python __mod__ method |
PyObject |
__mul__(PyObject right)
Equivalent to the standard Python __mul__ method |
PyObject |
__neg__()
Equivalent to the standard Python __neg__ method. |
boolean |
__nonzero__()
Equivalent to the standard Python __nonzero__ method. |
PyString |
__oct__()
Equivalent to the standard Python __oct__ method. |
PyObject |
__or__(PyObject right)
Equivalent to the standard Python __or__ method |
PyObject |
__pos__()
Equivalent to the standard Python __pos__ method. |
PyObject |
__pow__(PyObject right,
PyObject modulo)
Implements the three argument power function. |
PyObject |
__radd__(PyObject left)
Equivalent to the standard Python __radd__ method |
PyObject |
__rand__(PyObject left)
Equivalent to the standard Python __rand__ method |
PyObject |
__rdiv__(PyObject left)
Equivalent to the standard Python __rdiv__ method |
PyObject |
__rdivmod__(PyObject left)
Equivalent to the standard Python __rdivmod__ method |
PyObject |
__rfloordiv__(PyObject left)
Equivalent to the standard Python __rfloordiv__ method |
PyObject |
__rmod__(PyObject left)
Equivalent to the standard Python __rmod__ method |
PyObject |
__rmul__(PyObject left)
Equivalent to the standard Python __rmul__ method |
PyObject |
__ror__(PyObject left)
Equivalent to the standard Python __ror__ method |
PyObject |
__rpow__(PyObject left)
Equivalent to the standard Python __rpow__ method |
PyObject |
__rshift__(PyObject right)
Equivalent to the standard Python __rshift__ method |
PyObject |
__rsub__(PyObject left)
Equivalent to the standard Python __rsub__ method |
PyObject |
__rtruediv__(PyObject left)
Equivalent to the standard Python __rtruediv__ method |
PyObject |
__rxor__(PyObject left)
Equivalent to the standard Python __rxor__ method |
PyString |
__str__()
Equivalent to the standard Python __str__ method. |
PyObject |
__sub__(PyObject right)
Equivalent to the standard Python __sub__ method |
Object |
__tojava__(Class<?> c)
Equivalent to the Jython __tojava__ method. |
PyObject |
__truediv__(PyObject right)
Equivalent to the standard Python __truediv__ method |
PyUnicode |
__unicode__()
|
PyObject |
__xor__(PyObject right)
Equivalent to the standard Python __xor__ method |
static PyObject |
_pow(BigInteger value,
BigInteger y,
PyObject modulo,
PyObject left,
PyObject right)
|
int |
asIndex(PyObject err)
Convert this object into an index-sized integer. |
int |
asInt()
Convert this object into an int. |
int |
asInt(int index)
|
long |
asLong()
Convert this object longo an long. |
long |
asLong(int index)
|
double |
doubleValue()
|
long |
getLong(long min,
long max)
|
long |
getLong(long min,
long max,
String overflowMsg)
|
BigInteger |
getValue()
|
int |
hashCode()
|
boolean |
isIndex()
Determine if this object can act as an index (implements __index__). |
boolean |
isMappingType()
|
boolean |
isNumberType()
|
boolean |
isSequenceType()
|
static PyObject |
long___new__(PyNewWrapper new_,
boolean init,
PyType subtype,
PyObject[] args,
String[] keywords)
|
boolean |
long___nonzero__()
|
PyString |
long___str__()
|
double |
scaledDoubleValue(int[] exp)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final PyType TYPE
public static final BigInteger MIN_LONG
public static final BigInteger MAX_LONG
public static final BigInteger MAX_ULONG
@Deprecated public static final BigInteger minLong
@Deprecated public static final BigInteger maxLong
@Deprecated public static final BigInteger maxULong
Constructor Detail |
---|
public PyLong(PyType subType, BigInteger v)
public PyLong(BigInteger v)
public PyLong(double v)
public PyLong(long v)
public PyLong(String s)
Method Detail |
---|
public BigInteger getValue()
public static PyObject long___new__(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)
public String toString()
toString
in class PyObject
public int hashCode()
hashCode
in class PyObject
public boolean __nonzero__()
PyObject
PyObject
is considered true.
__nonzero__
in class PyObject
public boolean long___nonzero__()
public double doubleValue()
public double scaledDoubleValue(int[] exp)
public long getLong(long min, long max)
public long getLong(long min, long max, String overflowMsg)
public long asLong(int index)
asLong
in class PyObject
public int asInt(int index)
asInt
in class PyObject
public int asInt()
PyObject
asInt
in class PyObject
public long asLong()
PyObject
asLong
in class PyObject
public Object __tojava__(Class<?> c)
PyObject
Py.NoConversion
if this PyObject
can not be converted to the
desired Java class.
__tojava__
in class PyObject
c
- the Class to convert this PyObject
to.public int __cmp__(PyObject other)
PyObject
__cmp__
in class PyObject
other
- the object to compare this with.
public Object __coerce_ex__(PyObject other)
PyObject
__coerce_ex__
in class PyObject
other
- the other object involved in the coercion
public PyObject __add__(PyObject right)
PyObject
__add__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __radd__(PyObject left)
PyObject
__radd__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public PyObject __sub__(PyObject right)
PyObject
__sub__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __rsub__(PyObject left)
PyObject
__rsub__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public PyObject __mul__(PyObject right)
PyObject
__mul__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __rmul__(PyObject left)
PyObject
__rmul__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public PyObject __div__(PyObject right)
PyObject
__div__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __rdiv__(PyObject left)
PyObject
__rdiv__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public PyObject __floordiv__(PyObject right)
PyObject
__floordiv__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __rfloordiv__(PyObject left)
PyObject
__rfloordiv__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public PyObject __truediv__(PyObject right)
PyObject
__truediv__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __rtruediv__(PyObject left)
PyObject
__rtruediv__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public PyObject __mod__(PyObject right)
PyObject
__mod__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __rmod__(PyObject left)
PyObject
__rmod__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public PyObject __divmod__(PyObject right)
PyObject
__divmod__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __rdivmod__(PyObject left)
PyObject
__rdivmod__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public PyObject __pow__(PyObject right, PyObject modulo)
PyObject
__pow__
in class PyObject
right
- the power to raise this number to.modulo
- the modulus to perform this operation in or null if no
modulo is to be used
public PyObject __rpow__(PyObject left)
PyObject
__rpow__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public static PyObject _pow(BigInteger value, BigInteger y, PyObject modulo, PyObject left, PyObject right)
public PyObject __lshift__(PyObject right)
PyObject
__lshift__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __rshift__(PyObject right)
PyObject
__rshift__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __and__(PyObject right)
PyObject
__and__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __rand__(PyObject left)
PyObject
__rand__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public PyObject __xor__(PyObject right)
PyObject
__xor__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __rxor__(PyObject left)
PyObject
__rxor__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public PyObject __or__(PyObject right)
PyObject
__or__
in class PyObject
right
- the object to perform this binary operation with
(the right-hand operand).
public PyObject __ror__(PyObject left)
PyObject
__ror__
in class PyObject
left
- the object to perform this binary operation with
(the left-hand operand).
public PyObject __neg__()
PyObject
__neg__
in class PyObject
public PyObject __pos__()
PyObject
__pos__
in class PyObject
public PyObject __abs__()
PyObject
__abs__
in class PyObject
public PyObject __invert__()
PyObject
__invert__
in class PyObject
public PyObject __int__()
PyObject
__int__
in class PyObject
public PyObject __long__()
PyObject
__long__
in class PyObject
public PyFloat __float__()
PyObject
__float__
in class PyObject
public PyComplex __complex__()
PyObject
__complex__
in class PyObject
public PyString __oct__()
PyObject
__oct__
in class PyObject
public PyString __hex__()
PyObject
__hex__
in class PyObject
public PyString long___str__()
public PyString __str__()
PyObject
PyObject
is to
override the standard Java toString
method.
__str__
in class PyObject
public PyUnicode __unicode__()
__unicode__
in class PyObject
public PyTuple __getnewargs__()
__getnewargs__
in class PyObject
public PyObject __index__()
PyObject
__index__
in class PyObject
public boolean isIndex()
PyObject
isIndex
in class PyObject
public int asIndex(PyObject err)
PyObject
asIndex
in class PyObject
err
- the Python exception to raise on OverflowErrors
public boolean isMappingType()
isMappingType
in class PyObject
public boolean isNumberType()
isNumberType
in class PyObject
public boolean isSequenceType()
isSequenceType
in class PyObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |