| Modifier and Type | Field and Description |
|---|---|
| private final String[] | |
| private final MethodType |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | |
| pack-priv | Signature(Class<?>
the return value for the new signature retval, Class<?> the first argument type, often the receiver of an instance method firstArg, Class<?>[] the remaining argument types for the new signature restArgs, String... the argument names for the new signature argNames)Construct a new signature with the given return value, argument types, and argument names. |
| pack-priv | Signature(MethodType
the method type for the new signature methodType, String... the argument names for the new signature argNames)Construct a new signature with the given method type and argument names. |
| pack-priv | Signature(MethodType
the method type for the new signature methodType, String the first argument name for the new signature; for eventual instance methods, it can be "this" firstName, String... the remaining argument names for the new signature restNames)Construct a new signature with the given method type and argument names. |
| Modifier and Type | Method and Description |
|---|---|
| public Signature | |
| public Signature | Returns: a new signature with the added argumentsthe names of the arguments names, Class<?>... the types of the argument types)Append an argument (name + type) to the signature. |
| public int | |
| public String | Returns: the argument namethe index from which to get the argument name index)Retrieve the name of the argument at the given index. |
| public Signature | |
| public String[] | |
| public int | |
| public int | Returns: the offset at which the argument name was found or -1the argument name to search for pattern)Retrieve the offset of the given argument name in this signature's arguments. |
| public Class | Returns: the argument typethe index from which to get the argument type index)Get the argument type at the given index. |
| public Signature | |
| public Signature | |
| public Signature | Returns: the new signature with modified return valuethe class for the new signature's return type retval)Create a new signature based on this one with a different return type. |
| public Signature | |
| public Signature | |
| public Signature | Returns: a new signaturethe index of the argument to drop index)Drops the argument at the given index. |
| public Signature | |
| public Signature | Returns: a new signaturenumber of arguments to drop n)Drop the specified number of first arguments from this signature. |
| public Signature | |
| public Signature | Returns: a new signaturenumber of arguments to drop n)Drop the specified number of last arguments from this signature. |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| public Signature | |
| public String | |
| public Class | |
| public static Signature | |
| public int | |
| public Signature | |
| public Signature | Returns: a new signature with the added argumentsthe name of the argument before which to insert beforeName, String the name of the new argument name, Class<?> the type of the new argument type)Insert an argument (name + type) into the signature before the argument with the given name. |
| public Signature | Returns: a new signature with the added argumentsthe index at which to insert index, String[] the names of the new arguments names, Class<?>... the types of the new arguments types)Insert arguments (names + types) into the signature. |
| public Signature | Returns: a new Signature with the added argumentsthe name of the argument before which to insert beforeName, String[] the names of the new arguments names, Class<?>... the types of the new arguments types)Insert arguments (names + types) into the signature before the argument with the given name. |
| public String | |
| public Class | |
| private int[] | |
| public Signature | |
| public MethodHandle | Returns: a new handle that permutes appropriate positions based on the given permute argsthe method handle to target target, String... the arguments to permute permuteArgs)Produce a method handle permuting the arguments in this signature using the given permute arguments and targeting the given java.lang.invoke.MethodHandle. |
| public SmartHandle | Returns: a new SmartHandle that permutes this Signature's args into a call to the target SmartHandle.the SmartHandle to use as a permutation target target)Produce a new SmartHandle by permuting this Signature's arguments to the Signature of a target SmartHandle. |
| public Signature | Returns: a new signature with the added argumentsthe name of the argument name, Class<?> the type of the argument type)Prepend an argument (name + type) to the signature. |
| public Signature | Returns: a new signature with the added argumentsthe names of the arguments names, Class<?>... the types of the arguments types)Prepend arguments (names + types) to the signature. |
| public Signature | Returns: a new signature with the modified argumentthe old name of the argument oldName, String the new name of the argument; can be the same as old newName, Class<?> the new type of the argument; can be the same as old newType)Replace the named argument with a new name and type. |
| public static Signature | |
| public Signature | |
| public Signature | |
| public Signature | |
| public int[] | |
| public int[] | |
| public String | Returns: a human-readable representation of the signatureOverrides java. |
| public MethodType |
| argNames | back to summary |
|---|---|
| private final String[] argNames | |
| methodType | back to summary |
|---|---|
| private final MethodType methodType | |
| Signature | back to summary |
|---|---|
| pack-priv Signature(Class<?> retval) Construct a new signature with the given return value.
| |
| Signature | back to summary |
|---|---|
| pack-priv Signature(Class<?> retval, Class<?>[] argTypes, String... argNames) Construct a new signature with the given return value, argument types, and argument names. | |
| Signature | back to summary |
|---|---|
| pack-priv Signature(Class<?> retval, Class<?> firstArg, Class<?>[] restArgs, String... argNames) Construct a new signature with the given return value, argument types, and argument names. | |
| Signature | back to summary |
|---|---|
| pack-priv Signature(MethodType methodType, String... argNames) Construct a new signature with the given method type and argument names.
| |
| Signature | back to summary |
|---|---|
| pack-priv Signature(MethodType methodType, String firstName, String... restNames) Construct a new signature with the given method type and argument names.
| |
| appendArg | back to summary |
|---|---|
| public Signature appendArg(String name, Class<?> type) Append an argument (name + type) to the signature. | |
| appendArgs | back to summary |
|---|---|
| public Signature appendArgs(String[] names, Class<?>... types) Append an argument (name + type) to the signature. | |
| argCount | back to summary |
|---|---|
| public int argCount() The current argument count.
| |
| argName | back to summary |
|---|---|
| public String argName(int index) Retrieve the name of the argument at the given index.
| |
| argName | back to summary |
|---|---|
| public Signature argName(int index, String name) Set the argument name at the given index. | |
| argNames | back to summary |
|---|---|
| public String[] argNames() The current argument names for this signature.
| |
| argOffset | back to summary |
|---|---|
| public int argOffset(String name) Retrieve the offset of the given argument name in this signature's arguments. If the argument name is not in the argument list, returns -1.
| |
| argOffsets | back to summary |
|---|---|
| public int argOffsets(String pattern) Retrieve the offset of the given argument name in this signature's arguments. If the argument name is not in the argument list, returns -1.
| |
| argType | back to summary |
|---|---|
| public Class Get the argument type at the given index.
| |
| argType | back to summary |
|---|---|
| public Signature argType(int index, Class<?> type) Set the argument type at the given index. | |
| asFold | back to summary |
|---|---|
| public Signature asFold(Class<?> retval) Produce a new signature based on this one with a different return type. | |
| changeReturn | back to summary |
|---|---|
| public Signature changeReturn(Class<?> retval) Create a new signature based on this one with a different return type. | |
| collect | back to summary |
|---|---|
| public Signature collect(String newName, String oldPattern) Collect sequential arguments matching pattern into an array. They must have the same type. | |
| dropArg | back to summary |
|---|---|
| public Signature dropArg(String name) Drops the first argument with the given name. | |
| dropArg | back to summary |
|---|---|
| public Signature dropArg(int index) Drops the argument at the given index.
| |
| dropFirst | back to summary |
|---|---|
| public Signature dropFirst() Drop the first argument from this signature.
| |
| dropFirst | back to summary |
|---|---|
| public Signature dropFirst(int n) Drop the specified number of first arguments from this signature.
| |
| dropLast | back to summary |
|---|---|
| public Signature dropLast() Drop the last argument from this signature.
| |
| dropLast | back to summary |
|---|---|
| public Signature dropLast(int n) Drop the specified number of last arguments from this signature.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| exclude | back to summary |
|---|---|
| public Signature exclude(String... excludeArgs) Create a new signature containing the same return value as this one, but omitting the specified arguments. Blacklisting to #permute's whitelisting. | |
| firstArgName | back to summary |
|---|---|
| public String firstArgName() Get the first argument name.
| |
| firstArgType | back to summary |
|---|---|
| public Class Get the first argument type.
| |
| from | back to summary |
|---|---|
| public static Signature from(Class<?> retval, Class<?>[] argTypes, String... argNames) Create a new signature based on the given return value, argument types, and argument names | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| insertArg | back to summary |
|---|---|
| public Signature insertArg(int index, String name, Class<?> type) Insert an argument (name + type) into the signature. | |
| insertArg | back to summary |
|---|---|
| public Signature insertArg(String beforeName, String name, Class<?> type) Insert an argument (name + type) into the signature before the argument with the given name. | |
| insertArgs | back to summary |
|---|---|
| public Signature insertArgs(int index, String[] names, Class<?>... types) Insert arguments (names + types) into the signature. | |
| insertArgs | back to summary |
|---|---|
| public Signature insertArgs(String beforeName, String[] names, Class<?>... types) Insert arguments (names + types) into the signature before the argument with the given name. | |
| lastArgName | back to summary |
|---|---|
| public String lastArgName() Get the last argument name.
| |
| lastArgType | back to summary |
|---|---|
| public Class Get the last argument type.
| |
| nonMatchingTo | back to summary |
|---|---|
| private int[] nonMatchingTo(String... otherArgNames) | |
| permute | back to summary |
|---|---|
| public Signature permute(String... permuteArgs) Create a new signature containing the same return value as this one, but only the specified arguments. | |
| permuteWith | back to summary |
|---|---|
| public MethodHandle permuteWith(MethodHandle target, String... permuteArgs) Produce a method handle permuting the arguments in this signature using the given permute arguments and targeting the given java.lang.invoke.MethodHandle. Example:
Signature sig = Signature.returning(String.class).appendArg("a", int.class).appendArg("b", int.class);
MethodHandle handle = handleThatTakesOneInt();
MethodHandle newHandle = sig.permuteTo(handle, "b");
| |
| permuteWith | back to summary |
|---|---|
| public SmartHandle permuteWith(SmartHandle target) Produce a new SmartHandle by permuting this Signature's arguments to the Signature of a target SmartHandle. The new SmartHandle's signature will match this one, permuting those arguments and invoking the target handle.
| |
| prependArg | back to summary |
|---|---|
| public Signature prependArg(String name, Class<?> type) Prepend an argument (name + type) to the signature. | |
| prependArgs | back to summary |
|---|---|
| public Signature prependArgs(String[] names, Class<?>... types) Prepend arguments (names + types) to the signature. | |
| replaceArg | back to summary |
|---|---|
| public Signature replaceArg(String oldName, String newName, Class<?> newType) Replace the named argument with a new name and type. | |
| returning | back to summary |
|---|---|
| public static Signature returning(Class<?> retval) Create a new signature returning the given type. | |
| spread | back to summary |
|---|---|
| public Signature spread(String[] names, Class<?>... types) Spread the trailing [] argument into its component type assigning given names. | |
| spread | back to summary |
|---|---|
| public Signature spread(String... names) Spread the trailing [] argument into its component type assigning given names. | |
| spread | back to summary |
|---|---|
| public Signature spread(String baseName, int count) Spread the trailing [] argument into its component type assigning given names. | |
| to | back to summary |
|---|---|
| public int[] to(Signature other) Generate an array of argument offsets based on permuting this signature to the given signature.
| |
| to | back to summary |
|---|---|
| public int[] to(String... otherArgPatterns) Generate an array of argument offsets based on permuting this signature to the given signature. Repeats are permitted, and the patterns will be matched against actual argument names using regex matching.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Produce a human-readable representation of this signature. This representation uses Class#getSimpleName to improve readability.
| |
| type | back to summary |
|---|---|
| public MethodType type() The current java.lang.invoke.MethodType for this Signature.
| |