builtin_function_or_method object. Java
sub-classes represent either a built-in function or a built-in
method bound to a particular object.
| Modifier and Type | Class and Description |
|---|---|
| private abstract static class | PyJavaFunction.AbstractPositional
Base class for methods that accept between defined maximum and minimum numbers of arguments, that must be given by position. |
| private static class | PyJavaFunction.General
The implementation may have any signature allowed by
|
| private static class | PyJavaFunction.NoArgs
The implementation signature accepts no arguments. |
| private static class | PyJavaFunction.O1
The implementation signature requires one argument, which may be
supplied by |
| private static class | PyJavaFunction.O2
The implementation signature requires two arguments, which may be
supplied by |
| private static class | PyJavaFunction.O3
The implementation signature requires three arguments, which may
be supplied by |
| private static class | PyJavaFunction.Positional
A method represented by |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final ArgParser | argParser
An argument parser supplied to this |
| pack-priv final MethodHandle | handle
A Java |
| pack-priv final String | module
Name of the containing module (or |
| pack-priv final Object | self
The object to which this is bound as target (or |
| pack-priv static final PyType | TYPE
The type of Python object this class implements. |
| Access | Constructor and Description |
|---|---|
| protected | PyJavaFunction(ArgParser
parser defining the method argParser, MethodHandle a prepared prepared to the method defined handle, Object object to which bound (or self, String null if a static
method)name of the module supplying the definition module)Construct a Python |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Object | |
| pack-priv String | |
| protected Object | |
| pack-priv static PyJavaFunction | Returns: a Java method object supporting the signaturedescriptor being bound descr, Object object to which bound (or self)null if a static
method)Construct a |
| pack-priv static PyJavaFunction | Returns: A method descriptor supporting the signatureargument parser (provides name etc.) ap, MethodHandle raw handle to the method defined method, Object object to which bound (or self, String null if a static
method)name of the module supplying the definition (or
module)null if representing a bound method of a type)Construct a |
| public PyType | |
| public String | |
| public TypeError | Returns: aTypeError to throwexpressing the problem ae, Object[] positional arguments (only the number will matter) args, String[] of keyword arguments or names)nullImplements org. TypeError.
|
| argParser | back to summary |
|---|---|
| pack-priv final ArgParser argParser An argument parser supplied to this | |
| handle | back to summary |
|---|---|
| pack-priv final MethodHandle handle A Java | |
| module | back to summary |
|---|---|
| pack-priv final String module Name of the containing module (or | |
| self | back to summary |
|---|---|
| pack-priv final Object self The object to which this is bound as target (or
| |
| TYPE | back to summary |
|---|---|
| pack-priv static final PyType TYPE The type of Python object this class implements. | |
| PyJavaFunction | back to summary |
|---|---|
| protected PyJavaFunction(ArgParser argParser, MethodHandle handle, Object self, String module) Construct a Python
| |
| __call__ | back to summary |
|---|---|
| pack-priv Object __call__(Object[] args, String[] names) throws TypeError, Throwable | |
| __name__ | back to summary |
|---|---|
| pack-priv String __name__() | |
| __repr__ | back to summary |
|---|---|
| protected Object __repr__() throws Throwable | |
| from | back to summary |
|---|---|
| pack-priv static PyJavaFunction from(PyMethodDescr descr, Object self) throws TypeError, Throwable Construct a
a Java method object supporting the signature | |
| fromParser | back to summary |
|---|---|
| pack-priv static PyJavaFunction fromParser(ArgParser ap, MethodHandle method, Object self, String module) Construct a
A method descriptor supporting the signature | |
| getType | back to summary |
|---|---|
| public PyType getType() Implements org. Doc from org. The Python | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| typeError | back to summary |
|---|---|
| public TypeError typeError(ArgumentError ae, Object[] args, String[] names) Implements org. Translate a problem with the number and pattern of arguments, in
a failed attempt to call the wrapped method, to a Python
a
| |
Arguments may not be given by keyword. There is no excess argument (varargs) collector.
The number of arguments required by the wrapped Java method sets a maximum allowable number of arguments. Fewer arguments than this may be given, to the extent that defaults specified by the parser make up the difference. The number of available defaults determines the minimum number of arguments to be supplied.
Implementation Note
Sub-classes must define call(Object[]): the
default definition in FastCall is not enough.
| Modifier and Type | Field and Description |
|---|---|
| protected final Object[] | d
Default values of the trailing arguments. |
| protected final int | max
Maximum number of positional arguments in a call. |
| protected final int | min
Minimum number of positional arguments in a call. |
| Access | Constructor and Description |
|---|---|
| pack-priv | AbstractPositional(ArgParser argParser, MethodHandle handle, Object self, String module)
Construct a method descriptor, identifying the implementation by a parser and a method handle. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Object | |
| public Object | call(Object[]
all arguments given, positional then keyword args, String[] of keyword arguments or names)nullImplements org. Object[] and String[]), providing all the
argument values from the caller and names for those given by
keyword.
|
| public Object | call(Object[]
arguments given by position args)Overrides default org. |
| d | back to summary |
|---|---|
| protected final Object[] d Default values of the trailing arguments. | |
| max | back to summary |
|---|---|
| protected final int max Maximum number of positional arguments in a call. | |
| min | back to summary |
|---|---|
| protected final int min Minimum number of positional arguments in a call. | |
| AbstractPositional | back to summary |
|---|---|
| pack-priv AbstractPositional(ArgParser argParser, MethodHandle handle, Object self, String module) Construct a method descriptor, identifying the implementation by a parser and a method handle. | |
| __call__ | back to summary |
|---|---|
| pack-priv Object __call__(Object[] args, String[] names) throws TypeError, Throwable Overrides org.
| |
| call | back to summary |
|---|---|
| public Object call(Object[] args, String[] names) throws TypeError, Throwable Implements org. Doc from org. Invoke the target object with standard arguments
(
result of the invocation
| |
| call | back to summary |
|---|---|
| public Object call(Object[] args) throws TypeError, Throwable Overrides default org. Doc from org. Call the object with arguments given by position only. | |
ArgParser.
| Access | Constructor and Description |
|---|---|
| pack-priv | General(ArgParser
describing the signature of the method argParser, MethodHandle a prepared prepared to the method defined handle, Object object to which bound (or self, String null if a static
method)name of the module supplying the definition (or
module)null if representing a bound method of a type)Construct a method object, identifying the implementation by a parser and a method handle. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | call(Object[]
all arguments given, positional then keyword args, String[] of keyword arguments or names)nullImplements org. Object[] and String[]), providing all the
argument values from the caller and names for those given by
keyword.
|
| General | back to summary |
|---|---|
| pack-priv General(ArgParser argParser, MethodHandle handle, Object self, String module) Construct a method object, identifying the implementation by a parser and a method handle.
| |
| call | back to summary |
|---|---|
| public Object call(Object[] args, String[] names) throws TypeError, Throwable Implements org. Doc from org. Invoke the target object with standard arguments
(
result of the invocation
| |
| Access | Constructor and Description |
|---|---|
| pack-priv | NoArgs(ArgParser
describing the signature of the method argParser, MethodHandle a prepared prepared to the method defined handle, Object object to which bound (or self, String null if a static
method)name of the module supplying the definition (or
module)null if representing a bound method of a type)Construct a method object, identifying the implementation by a parser and a prepared method handle. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | call(Object[]
arguments given by position a)Overrides org. Overrides default org. |
| NoArgs | back to summary |
|---|---|
| pack-priv NoArgs(ArgParser argParser, MethodHandle handle, Object self, String module) Construct a method object, identifying the implementation by a parser and a prepared method handle.
| |
| call | back to summary |
|---|---|
| public Object call(Object[] a) throws Throwable Overrides org. Overrides default org. Doc from org. Call the object with arguments given by position only. | |
ArgParser#getDefaults().
| Access | Constructor and Description |
|---|---|
| pack-priv | O1(ArgParser
describing the signature of the method argParser, MethodHandle a prepared prepared to the method defined handle, Object object to which bound (or self, String null if a static
method)name of the module supplying the definition (or
module)null if representing a bound method of a type)Construct a method object, identifying the implementation by a parser and a method handle. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | call(Object[]
arguments given by position a)Overrides org. Overrides default org. |
| O1 | back to summary |
|---|---|
| pack-priv O1(ArgParser argParser, MethodHandle handle, Object self, String module) Construct a method object, identifying the implementation by a parser and a method handle.
| |
| call | back to summary |
|---|---|
| public Object call(Object[] a) throws TypeError, Throwable Overrides org. Overrides default org. Doc from org. Call the object with arguments given by position only. | |
ArgParser#getDefaults().
| Access | Constructor and Description |
|---|---|
| pack-priv | O2(ArgParser
describing the signature of the method argParser, MethodHandle handle, Object self, String module)Construct a method descriptor, identifying the implementation by a parser and a method handle. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | call(Object[]
arguments given by position a)Overrides org. Overrides default org. |
| public Object | call()
Overrides default org. |
| public Object | call(Object
single argument (may be a0)self)Overrides default org. |
| public Object | call(Object
zeroth argument (may be self, Object self)next argument a0, Object next argument a1)Overrides default org. |
| O2 | back to summary |
|---|---|
| pack-priv O2(ArgParser argParser, MethodHandle handle, Object self, String module) Construct a method descriptor, identifying the implementation by a parser and a method handle.
| |
| call | back to summary |
|---|---|
| public Object call(Object[] a) throws ArgumentError, TypeError, Throwable Overrides org. Overrides default org. Doc from org. Call the object with arguments given by position only.
| |
| call | back to summary |
|---|---|
| public Object call() throws Throwable Overrides default org. Doc from org. Call the object with arguments given by position only. | |
| call | back to summary |
|---|---|
| public Object call(Object a0) throws Throwable Overrides default org. Doc from org. Call the object with arguments given by position only. | |
| call | back to summary |
|---|---|
| public Object call(Object self, Object a0, Object a1) throws Throwable Overrides default org. Doc from org. Call the object with arguments given by position only. result of the invocation
| |
ArgParser#getDefaults().
| Access | Constructor and Description |
|---|---|
| pack-priv | O3(ArgParser
describing the signature of the method argParser, MethodHandle handle, Object self, String module)Construct a method descriptor, identifying the implementation by a parser and a method handle. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | call(Object[]
arguments given by position a)Overrides org. Overrides default org. |
| public Object | call()
Overrides default org. |
| public Object | call(Object
single argument (may be a0)self)Overrides default org. |
| public Object | call(Object
zeroth argument (may be a0, Object self)next argument a1)Overrides default org. |
| public Object | call(Object
zeroth argument (may be a0, Object self)next argument a1, Object next argument a2)Overrides default org. |
| O3 | back to summary |
|---|---|
| pack-priv O3(ArgParser argParser, MethodHandle handle, Object self, String module) Construct a method descriptor, identifying the implementation by a parser and a method handle.
| |
| call | back to summary |
|---|---|
| public Object call(Object[] a) throws ArgumentError, TypeError, Throwable Overrides org. Overrides default org. Doc from org. Call the object with arguments given by position only.
| |
| call | back to summary |
|---|---|
| public Object call() throws Throwable Overrides default org. Doc from org. Call the object with arguments given by position only. | |
| call | back to summary |
|---|---|
| public Object call(Object a0) throws Throwable Overrides default org. Doc from org. Call the object with arguments given by position only. | |
| call | back to summary |
|---|---|
| public Object call(Object a0, Object a1) throws Throwable Overrides default org. Doc from org. Call the object with arguments given by position only. result of the invocation
| |
| call | back to summary |
|---|---|
| public Object call(Object a0, Object a1, Object a2) throws Throwable Overrides default org. Doc from org. Call the object with arguments given by position only. result of the invocation
| |
Positional only accepts arguments
given by position. The constraints detailed for
AbstractPositional apply.
fromParser() will
only choose a Positional (or sub-class) representation of
the method when these conditions apply.
| Access | Constructor and Description |
|---|---|
| pack-priv | Positional(ArgParser
describing the signature of the method argParser, MethodHandle a prepared prepared to the method defined handle, Object object to which bound (or self, String null if a static
method)name of the module supplying the definition (or
module)null if representing a bound method of a type)Construct a method object, identifying the implementation by a parser and a method handle. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | call(Object[]
arguments given by position args)Overrides org. Overrides default org. |
| Positional | back to summary |
|---|---|
| pack-priv Positional(ArgParser argParser, MethodHandle handle, Object self, String module) Construct a method object, identifying the implementation by a parser and a method handle.
| |
| call | back to summary |
|---|---|
| public Object call(Object[] args) throws TypeError, Throwable Overrides org. Overrides default org. Doc from org. Call the object with arguments given by position only. | |