Class PyBoolean

All Implemented Interfaces:
Serializable

public class PyBoolean extends PyInteger
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.
See Also:
  • Field Details

    • TYPE

      public static final PyType TYPE
  • Constructor Details

    • PyBoolean

      public PyBoolean(boolean value)
  • Method Details

    • getBooleanValue

      public boolean getBooleanValue()
    • getValue

      public int getValue()
      Overrides:
      getValue in class PyInteger
    • bool_new

      public static PyObject bool_new(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)
    • toString

      public String toString()
      Overrides:
      toString in class PyInteger
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class PyInteger
    • __nonzero__

      public boolean __nonzero__()
      Description copied from class: PyObject
      Equivalent to the standard Python __nonzero__ method. Returns whether of not a given PyObject is considered true.
      Overrides:
      __nonzero__ in class PyInteger
    • __tojava__

      public Object __tojava__(Class<?> c)
      Description copied from class: PyObject
      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.
      Overrides:
      __tojava__ in class PyInteger
      Parameters:
      c - the Class to convert this PyObject to.
    • __and__

      public PyObject __and__(PyObject right)
      Description copied from class: PyObject
      Equivalent to the standard Python __and__ method
      Overrides:
      __and__ in class PyInteger
      Parameters:
      right - the object to perform this binary operation with (the right-hand operand).
      Returns:
      the result of the and, or null if this operation is not defined
    • __xor__

      public PyObject __xor__(PyObject right)
      Description copied from class: PyObject
      Equivalent to the standard Python __xor__ method
      Overrides:
      __xor__ in class PyInteger
      Parameters:
      right - the object to perform this binary operation with (the right-hand operand).
      Returns:
      the result of the xor, or null if this operation is not defined
    • __or__

      public PyObject __or__(PyObject right)
      Description copied from class: PyObject
      Equivalent to the standard Python __or__ method
      Overrides:
      __or__ in class PyInteger
      Parameters:
      right - the object to perform this binary operation with (the right-hand operand).
      Returns:
      the result of the or, or null if this operation is not defined
    • __neg__

      public PyObject __neg__()
      Description copied from class: PyObject
      Equivalent to the standard Python __neg__ method.
      Overrides:
      __neg__ in class PyInteger
      Returns:
      -this.
    • __pos__

      public PyObject __pos__()
      Description copied from class: PyObject
      Equivalent to the standard Python __pos__ method.
      Overrides:
      __pos__ in class PyInteger
      Returns:
      +this.
    • __abs__

      public PyObject __abs__()
      Description copied from class: PyObject
      Equivalent to the standard Python __abs__ method.
      Overrides:
      __abs__ in class PyInteger
      Returns:
      abs(this).