Class PyBuiltinFunctionSet

  • All Implemented Interfaces:
    java.io.Serializable, PyType.Newstyle
    Direct Known Subclasses:
    PyBuiltinMethodSet

    public class PyBuiltinFunctionSet
    extends PyBuiltinFunction
    A helper class for faster implementations of commonly called methods.

    Subclasses of PyBuiltinFunctionSet will implement some or all of the __call__ method with a switch on the index number.

    See Also:
    Serialized Form
    • Field Detail

      • exposed_as

        public static final java.lang.Class exposed_as
    • Constructor Detail

      • PyBuiltinFunctionSet

        public PyBuiltinFunctionSet​(java.lang.String name,
                                    int index)
        Creates a PyBuiltinFunctionSet that expects 1 argument.
      • PyBuiltinFunctionSet

        public PyBuiltinFunctionSet​(java.lang.String name,
                                    int index,
                                    int numargs)
      • PyBuiltinFunctionSet

        public PyBuiltinFunctionSet​(java.lang.String name,
                                    int index,
                                    int minargs,
                                    int maxargs)
      • PyBuiltinFunctionSet

        public PyBuiltinFunctionSet​(java.lang.String name,
                                    int index,
                                    int minargs,
                                    int maxargs,
                                    java.lang.String doc)
    • Method Detail

      • __call__

        public PyObject __call__​(PyObject[] args)
        Description copied from class: PyObject
        A variant of the __call__ method when no keywords are passed. The default behavior is to invoke __call__(args, keywords) with the appropriate arguments. The only reason to override this function would be for improved performance.
        Overrides:
        __call__ in class PyObject
        Parameters:
        args - all arguments to the function.
      • __call__

        public PyObject __call__​(PyObject[] args,
                                 java.lang.String[] kws)
        Description copied from class: PyObject
        The basic method to override when implementing a callable object. The first len(args)-len(keywords) members of args[] are plain arguments. The last len(keywords) arguments are the values of the keyword arguments.
        Overrides:
        __call__ in class PyObject
        Parameters:
        args - all arguments to the function (including keyword arguments).
        kws - the keywords used for all keyword arguments.
      • __call__

        public PyObject __call__()
        Description copied from class: PyObject
        A variant of the __call__ method with no arguments. The default behavior is to invoke __call__(args, keywords) with the appropriate arguments. The only reason to override this function would be for improved performance.
        Overrides:
        __call__ in class PyObject
      • __call__

        public PyObject __call__​(PyObject arg1)
        Description copied from class: PyObject
        A variant of the __call__ method with one argument. The default behavior is to invoke __call__(args, keywords) with the appropriate arguments. The only reason to override this function would be for improved performance.
        Overrides:
        __call__ in class PyObject
        Parameters:
        arg1 - the single argument to the function.
      • __call__

        public PyObject __call__​(PyObject arg1,
                                 PyObject arg2)
        Description copied from class: PyObject
        A variant of the __call__ method with two arguments. The default behavior is to invoke __call__(args, keywords) with the appropriate arguments. The only reason to override this function would be for improved performance.
        Overrides:
        __call__ in class PyObject
        Parameters:
        arg1 - the first argument to the function.
        arg2 - the second argument to the function.
      • __call__

        public PyObject __call__​(PyObject arg1,
                                 PyObject arg2,
                                 PyObject arg3)
        Description copied from class: PyObject
        A variant of the __call__ method with three arguments. The default behavior is to invoke __call__(args, keywords) with the appropriate arguments. The only reason to override this function would be for improved performance.
        Overrides:
        __call__ in class PyObject
        Parameters:
        arg1 - the first argument to the function.
        arg2 - the second argument to the function.
        arg3 - the third argument to the function.
      • __call__

        public PyObject __call__​(PyObject arg1,
                                 PyObject arg2,
                                 PyObject arg3,
                                 PyObject arg4)
        Description copied from class: PyObject
        A variant of the __call__ method with four arguments. The default behavior is to invoke __call__(args, keywords) with the appropriate arguments. The only reason to override this function would be for improved performance.
        Overrides:
        __call__ in class PyObject
        Parameters:
        arg1 - the first argument to the function.
        arg2 - the second argument to the function.
        arg3 - the third argument to the function.
        arg4 - the fourth argument to the function.