Examples of toJavaArray()


Examples of org.jruby.RubyArray.toJavaArray()

           
            // FIXME: not very efficient
            RubyArray splattedArgs = RuntimeHelpers.splatValue(restArg);           
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(variableValues, 0, argValues, 0, totalArgs);
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
           
            return argValues;
        }
    }
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

            IRubyObject restArg = getValue(staticScope.getRestArg(), 0);
           
            // FIXME: not very efficient
            RubyArray splattedArgs = RuntimeHelpers.splatValue(restArg);           
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
           
            if (totalArgs == 1) {
                argValues[0] = variableValueZero;
            }
           
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

            assert restArg != null;
           
            // FIXME: not very efficient
            RubyArray splattedArgs = RuntimeHelpers.splatValue(restArg);           
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
            switch (totalArgs) {
            case 4:
                argValues[3] = variableValueThree;
            case 3:
                argValues[2] = variableValueTwo;
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

           
            // FIXME: not very efficient
            RubyArray splattedArgs = RuntimeHelpers.splatValue(restArg);           
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(variableValues, 0, argValues, 0, totalArgs);
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
           
            return argValues;
        }
    }
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

            assert restArg != null;
           
            // FIXME: not very efficient
            RubyArray splattedArgs = RuntimeHelpers.splatValue(restArg);           
            IRubyObject[] argValues = new IRubyObject[totalArgs + splattedArgs.size()];
            System.arraycopy(splattedArgs.toJavaArray(), 0, argValues, totalArgs, splattedArgs.size());
            switch (totalArgs) {
            case 2:
                argValues[1] = variableValueOne;
            case 1:
                argValues[0] = variableValueZero;
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

        if (argsNode == null) { // attribute set.
            RuntimeHelpers.invoke(context, receiver, getName(), new IRubyObject[] {value}, CallType.NORMAL, Block.NULL_BLOCK);
        } else { // element set
            RubyArray args = (RubyArray)argsNode.interpret(runtime, context, self, block);
            args.append(value);
            RuntimeHelpers.invoke(context, receiver, getName(), args.toJavaArray(), CallType.NORMAL, Block.NULL_BLOCK);
        }
       
        return runtime.getNil();
    }
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

        if (argsNode == null) { // attribute set.
            RuntimeHelpers.invoke(context, receiver, name, value);
        } else { // element set
            RubyArray args = (RubyArray) argsNode.interpret(runtime, context, self, block);
            args.append(value);
            RuntimeHelpers.invoke(context, receiver, name, args.toJavaArray());
        }
       
        return runtime.getNil();
    }
   
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

        if (argsNode == null) { // attribute set.
            RuntimeHelpers.invoke(context, receiver, name, value, CallType.NORMAL, Block.NULL_BLOCK);
        } else { // element set
            RubyArray args = (RubyArray) argsNode.interpret(runtime, context, self, block);
            args.append(value);
            RuntimeHelpers.invoke(context, receiver, name, args.toJavaArray(), CallType.NORMAL, Block.NULL_BLOCK);
        }
       
        return runtime.getNil();
    }
   
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

                            throw context.getRuntime().newTypeError("append_features called with non-class");
                        }
                        RubyClass target = (RubyClass)arg;
                        RubyArray javaInterfaceMods = (RubyArray)self.getInstanceVariables().fastGetInstanceVariable("@java_interface_mods");

                        target.include(javaInterfaceMods.toJavaArray());

                        return RuntimeHelpers.invokeAs(context, clazz.getSuperClass(), self, name, arg, block);
                    }
                });
            } else {
View Full Code Here

Examples of org.jruby.RubyArray.toJavaArray()

        if (preArgsCount == -1) {
            // Masgn for 1.8 and 1.9 pre-reqd. args always comes down this path!
            if (index >= n) {
                return RubyArray.newEmptyArray(context.runtime);
            } else {
                return RubyArray.newArrayNoCopy(context.runtime, rubyArray.toJavaArray(), index, (n - index));
            }
        } else {
            // Masgn for 1.9 post-reqd args always come down this path
            if ((preArgsCount >= n) || (preArgsCount + postArgsCount >= n)) {
                return RubyArray.newEmptyArray(context.runtime);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.