Class ScalarCData

All Implemented Interfaces:
Serializable, Traverseproc

public class ScalarCData extends CData
See Also:
  • Field Details

    • TYPE

      public static final PyType TYPE
  • Method Details

    • ScalarCData_new

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

      public static final PyObject from_address(PyType subtype, PyObject address)
    • getValue

      public PyObject getValue()
    • setValue

      public void setValue(PyObject value)
    • asInt

      public int asInt()
      Description copied from class: PyObject
      Convert this object into an int. Throws a PyException on failure.
      Overrides:
      asInt in class PyObject
      Returns:
      an int value
    • asLong

      public long asLong(int index) throws PyObject.ConversionException
      Overrides:
      asLong in class PyObject
      Throws:
      PyObject.ConversionException
    • asLong

      public long asLong()
      Description copied from class: PyObject
      Convert this object into a long. Throws a PyException on failure.
      Overrides:
      asLong in class PyObject
      Returns:
      an long value
    • __int__

      public PyObject __int__()
      Description copied from class: PyObject
      Equivalent to the standard Python __int__ method. Should only be overridden by numeric objects that can be reasonably coerced into an integer.
      Overrides:
      __int__ in class PyObject
      Returns:
      an integer corresponding to the value of this object.
    • __long__

      public PyObject __long__()
      Description copied from class: PyObject
      Equivalent to the standard Python __long__ method. Should only be overridden by numeric objects that can be reasonably coerced into a python long.
      Overrides:
      __long__ in class PyObject
      Returns:
      a PyLong or PyInteger corresponding to the value of this object.
    • __float__

      public PyFloat __float__()
      Description copied from class: PyObject
      Equivalent to the standard Python __float__ method. Should only be overridden by numeric objects that can be reasonably coerced into a python float.
      Overrides:
      __float__ in class PyObject
      Returns:
      a float corresponding to the value of this object.
    • toString

      public final String toString()
      Overrides:
      toString in class PyObject
    • traverse

      public int traverse(Visitproc visit, Object arg)
      Description copied from interface: Traverseproc
      Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc.visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc.visit(PyObject, Object) must not be called with a null PyObject-argument.
      Specified by:
      traverse in interface Traverseproc
      Overrides:
      traverse in class CData
    • refersDirectlyTo

      public boolean refersDirectlyTo(PyObject ob)
      Description copied from interface: Traverseproc
      Optional operation. Should only be implemented if it is more efficient than calling Traverseproc.traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.
      Specified by:
      refersDirectlyTo in interface Traverseproc
      Overrides:
      refersDirectlyTo in class CData