/** * Create a new SmartBinder with from the given types and argument name. * * @param retType the type of the return value to start with * @param name the name of the sole argument * @param type the sole argument's type * @return a new SmartBinder */ public static SmartBinder from(Class<?> retType, String name, Class<?> type) { return from(Signature.returning(retType).appendArg(name, type)); }
startSig = startSig.appendArg("args", IRubyObject[].class); } else { for (int i = 0; i < arity; i++) { startSig = startSig.appendArg("arg" + i, IRubyObject.class); startSig = startSig.appendArg("block", Block.class); fullSignature = signature = startSig; } else { startSig = startSig.appendArg("args", IRubyObject[].class); } else { for (int i = 0; i < arity; i++) { startSig = startSig.appendArg("arg" + i, IRubyObject.class); fullSignature = startSig.appendArg("block", Block.class);
/** * Create a new SmartBinder from the given types and argument name, * using the given Lookup for any handle lookups. * * @param lookup the Lookup to use for handle lookups * @param retType the type of the return value to start with * @param name the name of the sole arguments * @param type the sole argument's type * @return a new SmartBinder */ public static SmartBinder from(Lookup lookup, Class<?> retType, String name, Class<?> type) { return from(lookup, Signature.returning(retType).appendArg(name, type)); }
startSig = startSig.appendArg("args", IRubyObject[].class); } else { for (int i = 0; i < arity; i++) { startSig = startSig.appendArg("arg" + i, IRubyObject.class); startSig = startSig.appendArg("block", Block.class); fullSignature = signature = startSig; } else { startSig = startSig.appendArg("args", IRubyObject[].class); } else { for (int i = 0; i < arity; i++) { startSig = startSig.appendArg("arg" + i, IRubyObject.class); fullSignature = startSig.appendArg("block", Block.class);
/** * Append the given argument to the argument list, assigning it the * given name. * * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the append applied */ public SmartBinder append(String name, Object value) { return new SmartBinder(this, signature().appendArg(name, value.getClass()), binder.append(value)); }
/** * Append the given argument to the argument list, assigning it the * given name. * * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the append applied */ public SmartBinder append(String name, int value) { return new SmartBinder(this, signature().appendArg(name, int.class), binder.append(value)); }
startSig = startSig.appendArg("args", IRubyObject[].class); } else { for (int i = 0; i < arity; i++) { startSig = startSig.appendArg("arg" + i, IRubyObject.class); startSig = startSig.appendArg("block", Block.class); fullSignature = signature = startSig; } else { startSig = startSig.appendArg("args", IRubyObject[].class); } else { for (int i = 0; i < arity; i++) { startSig = startSig.appendArg("arg" + i, IRubyObject.class); fullSignature = startSig.appendArg("block", Block.class);
/** * Append the given argument to the argument list, assigning it the * given name. * * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the append applied */ public SmartBinder append(String name, float value) { return new SmartBinder(this, signature().appendArg(name, float.class), binder.append(value)); }
startSig = startSig.appendArg("args", IRubyObject[].class); } else { for (int i = 0; i < arity; i++) { startSig = startSig.appendArg("arg" + i, IRubyObject.class); startSig = startSig.appendArg("block", Block.class); fullSignature = signature = startSig; } else { startSig = startSig.appendArg("args", IRubyObject[].class); } else { for (int i = 0; i < arity; i++) { startSig = startSig.appendArg("arg" + i, IRubyObject.class); fullSignature = startSig.appendArg("block", Block.class);
/** * Append the given argument to the argument list, assigning it the * given name. * * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the append applied */ public SmartBinder append(String name, byte value) { return new SmartBinder(this, signature().appendArg(name, byte.class), binder.append(value)); }
/** * Append the given argument to the argument list, assigning it the * given name. * * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the append applied */ public SmartBinder append(String name, long value) { return new SmartBinder(this, signature().appendArg(name, long.class), binder.append(value)); }
/** * Append the given argument to the argument list, assigning it the * given name. * * @param name the name of the new argument * @param type the type to use in the new signature * @param value the value of the new argument * @return a new SmartBinder with the append applied */ public SmartBinder append(String name, Class<?> type, Object value) { return new SmartBinder(this, signature().appendArg(name, type), binder.append(new Class<?>[]{type}, value)); }
/** * Drop an argument from the handle at the end, returning a new * SmartHandle. * * @param newName name of the argument * @param type type of the argument * @return a new SmartHandle with the additional argument */ public SmartHandle dropLast(String newName, Class<?> type) { return new SmartHandle(signature.appendArg(newName, type), MethodHandles.dropArguments(handle, signature.argOffset(newName), type)); }
/** * Append the given argument to the argument list, assigning it the * given name. * * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the append applied */ public SmartBinder append(String name, double value) { return new SmartBinder(this, signature().appendArg(name, double.class), binder.append(value)); }
/** * Append the given argument to the argument list, assigning it the * given name. * * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the append applied */ public SmartBinder append(String name, boolean value) { return new SmartBinder(this, signature().appendArg(name, boolean.class), binder.append(value)); }
/** * Append the given argument to the argument list, assigning it the * given name. * * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the append applied */ public SmartBinder append(String name, short value) { return new SmartBinder(this, signature().appendArg(name, short.class), binder.append(value)); }
/** * Append the given argument to the argument list, assigning it the * given name. * * @param name the name of the new argument * @param value the value of the new argument * @return a new SmartBinder with the append applied */ public SmartBinder append(String name, char value) { return new SmartBinder(this, signature().appendArg(name, char.class), binder.append(value)); }
.appendArg("context", ThreadContext.class) .appendArg("self", IRubyObject.class) .appendArg("args", IRubyObject[].class) .appendArg("block", Block.class); .from(Signature.returning(MethodHandle.class).appendArg("targets", MethodHandle[].class).appendArg("arity", int.class)) .arrayGet(); .from(Signature.returning(MethodHandle.class).appendArg("args", IRubyObject[].class)) .filterReturn(HANDLE_GETTER.bindTo(varargsTargets)) .cast(int.class, Object.class)
.appendArg("context", ThreadContext.class) .appendArg("self", IRubyObject.class) .appendArg("args", IRubyObject[].class) .appendArg("block", Block.class); .from(Signature.returning(MethodHandle.class).appendArg("targets", MethodHandle[].class).appendArg("arity", int.class)) .arrayGet(); .from(Signature.returning(MethodHandle.class).appendArg("args", IRubyObject[].class)) .filterReturn(HANDLE_GETTER.bindTo(varargsTargets)) .cast(int.class, Object.class)