enum MethodSignature enumerates the method signatures
for which an optimised implementation is possible. Sub-classes of
PyJavaFunction and PyMethodDescr correspond to
these values. It is not required that each value have a distinct
optimised sub-class. This enum is used internally to
choose between these sub-classes.
| Modifier and Type | Class and Description |
|---|---|
| private static class | MethodSignature.Util
Handle utilities, supporting signature creation. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final MethodType | boundType
The type of method handles matching this method signature when it describes a bound or static method. |
| pack-priv final MethodHandle | |
| public static final MethodSignature | GENERAL
Full generality of ArgParser allowed, after |
| pack-priv final MethodType | instanceType
The type of method handles matching this method signature when it describes an instance method. |
| public static final MethodSignature | NOARGS
No arguments allowed after |
| public static final MethodSignature | O1
One argument allowed, possibly after |
| public static final MethodSignature | O2
Two arguments allowed, possibly after |
| public static final MethodSignature | O3
Three arguments allowed, possibly after |
| public static final MethodSignature | POSITIONAL
Only positional arguments allowed, after |
| private final boolean | useArray
The second parameter is an object array. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static final MethodHandle | Returns: handle compatible withmethodDefthe handle to be prepared (or null for empty) raw, int index in the type at which to start. pos)Adapt an arbitrary method handle to one that expects arguments
from a given position onwards to be |
| pack-priv static MethodSignature | Returns: a chosenMethodSignatureto look for mt)Choose a |
| pack-priv static MethodSignature | Returns: a chosenMethodSignatureargument parser describing the method ap)Choose a |
| private static MethodSignature | Returns: chosen method signaturenumber of arguments n)Select a (potential) optimisation for a method that accepts arguments only by position. |
| pack-priv MethodHandle | Returns: handle consistent with thisMethodSignatureto which the handle is made to conform ap, MethodHandle handle representing the Java implementation raw)Prepare a raw method handle, consistent with this
|
| pack-priv MethodHandle | Returns: handle consistent with thisMethodSignatureto which the handle is made to conform ap, MethodHandle handle representing the Java implementation raw, Object to bind as the first argument if not Python static self)Prepare and bind a provided raw method handle, consistent with
this |
| public static MethodSignature | |
| public static MethodSignature[] |
| boundType | back to summary |
|---|---|
| pack-priv final MethodType boundType The type of method handles matching this method signature when it
describes a bound or static method. For | |
| empty | back to summary |
|---|---|
| pack-priv final MethodHandle empty Handle to throw a | |
| GENERAL | back to summary |
|---|---|
| public static final MethodSignature GENERAL Full generality of ArgParser allowed, after | |
| instanceType | back to summary |
|---|---|
| pack-priv final MethodType instanceType The type of method handles matching this method signature when it
describes an instance method. This differs from
| |
| NOARGS | back to summary |
|---|---|
| public static final MethodSignature NOARGS No arguments allowed after | |
| O1 | back to summary |
|---|---|
| public static final MethodSignature O1 One argument allowed, possibly after | |
| O2 | back to summary |
|---|---|
| public static final MethodSignature O2 Two arguments allowed, possibly after | |
| O3 | back to summary |
|---|---|
| public static final MethodSignature O3 Three arguments allowed, possibly after | |
| POSITIONAL | back to summary |
|---|---|
| public static final MethodSignature POSITIONAL Only positional arguments allowed, after | |
| useArray | back to summary |
|---|---|
| private final boolean useArray The second parameter is an object array. | |
| MethodSignature | back to summary |
|---|---|
| private MethodSignature(Class<?>... ptypes) | |
| adapt | back to summary |
|---|---|
| pack-priv static final MethodHandle adapt(MethodHandle raw, int pos) Adapt an arbitrary method handle to one that expects arguments
from a given position onwards to be
handle compatible with | |
| from | back to summary |
|---|---|
| pack-priv static MethodSignature from(MethodType mt) Choose a
| |
| fromParser | back to summary |
|---|---|
| pack-priv static MethodSignature fromParser(ArgParser ap) Choose a
| |
| positional | back to summary |
|---|---|
| private static MethodSignature positional(int n) Select a (potential) optimisation for a method that accepts arguments only by position. Signatures that allow only positional arguments (optionally with default values for trailing parameters not filled by the argument) may be optimised if the number is not too great.
| |
| prepare | back to summary |
|---|---|
| pack-priv MethodHandle prepare(ArgParser ap, MethodHandle raw) Prepare a raw method handle, consistent with this
handle consistent with this | |
| prepareBound | back to summary |
|---|---|
| pack-priv MethodHandle prepareBound(ArgParser ap, MethodHandle raw, Object self) Prepare and bind a provided raw method handle, consistent with
this
handle consistent with this | |
| valueOf | back to summary |
|---|---|
| public static MethodSignature valueOf(String name) | |
| values | back to summary |
|---|---|
| public static MethodSignature[] values() | |
| Modifier and Type | Field and Description |
|---|---|
| private static final Slot. | |
| pack-priv static final MethodHandle | THROW_EMPTY
A handle with signature |
| Access | Constructor and Description |
|---|---|
| private |
| EMPTY | back to summary |
|---|---|
| private static final Slot. Single re-used instance of | |
| THROW_EMPTY | back to summary |
|---|---|
| pack-priv static final MethodHandle THROW_EMPTY A handle with signature | |
| Util | back to summary |
|---|---|
| private Util() | |