Top Description Fields Constructors Methods
org.python.core

public Class PyBoolean

extends PyInteger
Class Inheritance
Annotations
@Untraversable
@ExposedType
name:bool
isBaseType:false
doc:bool(x) -> bool Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
Imports
org.python.expose.ExposedMethod, .ExposedNew, .ExposedType, .MethodType

The builtin python bool. It would be nice if it didn't extend PyInteger, but too hard to avoid pre-Python 2.2 semantics here.

Field Summary

Modifier and TypeField and Description
public static final PyType
private final boolean
Inherited from org.python.core.PyInteger:
MAX_INTmaxIntMIN_INTminInt

Constructor Summary

AccessConstructor and Description
public
PyBoolean(boolean value)

Method Summary

Modifier and TypeMethod and Description
public PyObject
__abs__()

Overrides org.python.core.PyInteger.__abs__.

Equivalent to the standard Python __abs__ method.

public PyObject
__and__(PyObject
the object to perform this binary operation with (the right-hand operand).
right
)

Overrides org.python.core.PyInteger.__and__.

Equivalent to the standard Python __and__ method

public PyObject
__neg__()

Overrides org.python.core.PyInteger.__neg__.

Equivalent to the standard Python __neg__ method.

public boolean
__nonzero__()

Overrides org.python.core.PyInteger.__nonzero__.

Equivalent to the standard Python __nonzero__ method.

public PyObject
__or__(PyObject
the object to perform this binary operation with (the right-hand operand).
right
)

Overrides org.python.core.PyInteger.__or__.

Equivalent to the standard Python __or__ method

public PyObject
__pos__()

Overrides org.python.core.PyInteger.__pos__.

Equivalent to the standard Python __pos__ method.

public Object
__tojava__(Class<?>
the Class to convert this PyObject to.
c
)

Overrides org.python.core.PyInteger.__tojava__.

Equivalent to the Jython __tojava__ method.

public PyObject
__xor__(PyObject
the object to perform this binary operation with (the right-hand operand).
right
)

Overrides org.python.core.PyInteger.__xor__.

Equivalent to the standard Python __xor__ method

pack-priv final PyObject
pack-priv final PyObject
pack-priv final int
pack-priv final PyObject
pack-priv final boolean
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
public static PyObject
bool_new(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)

pack-priv final String
public boolean
public int
public int
hashCode()

Overrides org.python.core.PyInteger.hashCode.

Returns a hash code value for this object.

public String
toString()

Overrides org.python.core.PyInteger.toString.

Returns a string representation of the object.

Inherited from org.python.core.PyInteger:
__add____cmp____coerce_ex____complex____div____divmod____float____floordiv____format____getnewargs____hex____index____int____invert____long____lshift____mod____mul____oct____pow____radd____rdiv____rfloordiv____rmod____rmul____rpow____rshift____rsub____rtruediv____sub____truediv____trunc__asIndexasIntasIntasLongasLongbit_lengthconjugategetDenominatorgetImaggetNumeratorgetRealint___abs__int___add__int___and__int___cmp__int___coerce__int___coerce_ex__int___div__int___divmod__int___float__int___floordiv__int___format__int___getnewargs__int___hex__int___index__int___int__int___invert__int___long__int___lshift__int___mod__int___mul__int___neg__int___nonzero__int___oct__int___or__int___pos__int___pow__int___radd__int___rand__int___rdiv__int___rdivmod__int___rfloordiv__int___rlshift__int___rmod__int___rmul__int___ror__int___rpow__int___rrshift__int___rshift__int___rsub__int___rtruediv__int___rxor__int___sub__int___truediv__int___trunc__int___xor__int_bit_lengthint_conjugateint_hashCodeint_newint_toStringisIndexisMappingTypeisNumberTypeisSequenceTypeprepareFormatter

Field Detail

TYPEback to summary
public static final PyType TYPE

Hides org.python.core.PyInteger.TYPE.

valueback to summary
private final boolean value

Hides org.python.core.PyInteger.value.

Constructor Detail

PyBooleanback to summary
public PyBoolean(boolean value)

Method Detail

__abs__back to summary
public PyObject __abs__()

Overrides org.python.core.PyInteger.__abs__.

Doc from org.python.core.PyObject.__abs__.

Equivalent to the standard Python __abs__ method.

Returns:PyObject

abs(this).

Annotations
@Override

__and__back to summary
public PyObject __and__(PyObject right)

Overrides org.python.core.PyInteger.__and__.

Doc from org.python.core.PyObject.__and__.

Equivalent to the standard Python __and__ method

Parameters
right:PyObject

the object to perform this binary operation with (the right-hand operand).

Returns:PyObject

the result of the and, or null if this operation is not defined

Annotations
@Override

__neg__back to summary
public PyObject __neg__()

Overrides org.python.core.PyInteger.__neg__.

Doc from org.python.core.PyObject.__neg__.

Equivalent to the standard Python __neg__ method.

Returns:PyObject

-this.

Annotations
@Override

__nonzero__back to summary
public boolean __nonzero__()

Overrides org.python.core.PyInteger.__nonzero__.

Doc from org.python.core.PyObject.__nonzero__.

Equivalent to the standard Python __nonzero__ method. Returns whether of not a given PyObject is considered true.

Annotations
@Override
__or__back to summary
public PyObject __or__(PyObject right)

Overrides org.python.core.PyInteger.__or__.

Doc from org.python.core.PyObject.__or__.

Equivalent to the standard Python __or__ method

Parameters
right:PyObject

the object to perform this binary operation with (the right-hand operand).

Returns:PyObject

the result of the or, or null if this operation is not defined

Annotations
@Override

__pos__back to summary
public PyObject __pos__()

Overrides org.python.core.PyInteger.__pos__.

Doc from org.python.core.PyObject.__pos__.

Equivalent to the standard Python __pos__ method.

Returns:PyObject

+this.

Annotations
@Override

__tojava__back to summary
public Object __tojava__(Class<?> c)

Overrides org.python.core.PyInteger.__tojava__.

Doc from org.python.core.PyObject.__tojava__.

Equivalent to the Jython __tojava__ method. Tries to coerce this object to an instance of the requested Java class. Returns the special object Py.NoConversion if this PyObject can not be converted to the desired Java class.

Parameters
c:Class<?>

the Class to convert this PyObject to.

Annotations
@Override
__xor__back to summary
public PyObject __xor__(PyObject right)

Overrides org.python.core.PyInteger.__xor__.

Doc from org.python.core.PyObject.__xor__.

Equivalent to the standard Python __xor__ method

Parameters
right:PyObject

the object to perform this binary operation with (the right-hand operand).

Returns:PyObject

the result of the xor, or null if this operation is not defined

Annotations
@Override

bool___abs__back to summary
pack-priv final PyObject bool___abs__()
Annotations
@ExposedMethod
doc:x.__abs__() <==> abs(x)
bool___and__back to summary
pack-priv final PyObject bool___and__(PyObject right)
Annotations
@ExposedMethod
type:BINARY
doc:x.__and__(y) <==> x&y
bool___hash__back to summary
pack-priv final int bool___hash__()
Annotations
@ExposedMethod
doc:x.__hash__() <==> hash(x)
bool___neg__back to summary
pack-priv final PyObject bool___neg__()
Annotations
@ExposedMethod
doc:x.__neg__() <==> -x
bool___nonzero__back to summary
pack-priv final boolean bool___nonzero__()
Annotations
@ExposedMethod
doc:x.__nonzero__() <==> x != 0
bool___or__back to summary
pack-priv final PyObject bool___or__(PyObject right)
Annotations
@ExposedMethod
type:BINARY
doc:x.__or__(y) <==> x|y
bool___pos__back to summary
pack-priv final PyObject bool___pos__()
Annotations
@ExposedMethod
doc:x.__pos__() <==> +x
bool___xor__back to summary
pack-priv final PyObject bool___xor__(PyObject right)
Annotations
@ExposedMethod
type:BINARY
doc:x.__xor__(y) <==> x^y
bool_newback to summary
public static PyObject bool_new(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)
Annotations
@ExposedNew
bool_toStringback to summary
pack-priv final String bool_toString()
Annotations
@ExposedMethod
names:__str__, __repr__
doc:x.__str__() <==> str(x)
getBooleanValueback to summary
public boolean getBooleanValue()
getValueback to summary
public int getValue()

Overrides org.python.core.PyInteger.getValue.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides org.python.core.PyInteger.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override

toStringback to summary
public String toString()

Overrides org.python.core.PyInteger.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override