Examples of eltInternal()


Examples of org.jruby.RubyArray.eltInternal()

    }
   
    public static RubyBoolean isWhenTriggered(IRubyObject expression, IRubyObject expressionsObject, ThreadContext context) {
        RubyArray expressions = RuntimeHelpers.splatValue(expressionsObject);
        for (int j = 0,k = expressions.getLength(); j < k; j++) {
            IRubyObject condition = expressions.eltInternal(j);

            if ((expression != null && condition.callMethod(context, MethodIndex.OP_EQQ, "===", expression)
                    .isTrue())
                    || (expression == null && condition.isTrue())) {
                return context.getRuntime().getTrue();
View Full Code Here

Examples of org.jruby.RubyArray.eltInternal()

       
        if (javaClass().isArray()) {
            // if it's an array of arrays, recurse with the component type
            for (int i = 0; i < rubyArray.size(); i++) {
                JavaClass componentType = component_type();
                IRubyObject wrappedComponentArray = componentType.javaArrayFromRubyArray(context, rubyArray.eltInternal(i));
                javaArray.setWithExceptionHandling(i, JavaUtil.unwrapJavaObject(wrappedComponentArray));
            }
        } else {
            ArrayJavaAddons.copyDataToJavaArray(context, rubyArray, javaArray);
        }
View Full Code Here

Examples of org.jruby.RubyArray.eltInternal()

                singleton.addMethod("implement_all", new JavaMethodOne(clazz, Visibility.PRIVATE) {
                    @Override
                    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg) {
                        RubyArray javaInterfaces = (RubyArray)self.getInstanceVariables().fastGetInstanceVariable("@java_interfaces");
                        for (int i = 0; i < javaInterfaces.size(); i++) {
                            RuntimeHelpers.invoke(context, Java.JavaUtilities.get_interface_module(self, javaInterfaces.eltInternal(i)), "implement", self);
                        }
                        return javaInterfaces;
                    }
                });
            }
View Full Code Here

Examples of org.jruby.RubyArray.eltInternal()

            struct_type = (RubyClass)sClass;
        }
        IRubyObject st = struct_type.callMethod(runtime.getCurrentContext(),"new");
        RubyArray members = RubyStruct.members(struct_type,Block.NULL_BLOCK);
        for(int i=0,j=members.size();i<j;i++) {
            IRubyObject m = members.eltInternal(i);
            st.callMethod(runtime.getCurrentContext(), m.toString() + "=", (IRubyObject)val.get(m));
        }
        for(Iterator iter = props.entrySet().iterator();iter.hasNext();) {
            Map.Entry em = (Map.Entry)iter.next();
            ((RubyObject)st).instance_variable_set((IRubyObject)em.getKey(),(IRubyObject)em.getValue());
View Full Code Here

Examples of org.jruby.RubyArray.eltInternal()

                }
                JavaProxyClass realProxyClass = (JavaProxyClass)proxyClass;
                RubyArray constructors = realProxyClass.constructors();
                ArrayList<JavaProxyConstructor> forArity = new ArrayList<JavaProxyConstructor>();
                for (int i = 0; i < constructors.size(); i++) {
                    JavaProxyConstructor constructor = (JavaProxyConstructor)constructors.eltInternal(i);
                    if (constructor.getParameterTypes().length == args.length) {
                        forArity.add(constructor);
                    }
                }
                if (forArity.size() == 0) {
View Full Code Here

Examples of org.jruby.RubyArray.eltInternal()

           
            switch (nodes.size()) {
                case 0:
                    return callAdapter.call(context, self, self);
                case 1:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0));
                case 2:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0), nodes.eltInternal(1));
                case 3:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0), nodes.eltInternal(1), nodes.eltInternal(2));
                default:
View Full Code Here

Examples of org.jruby.RubyArray.eltInternal()

                case 0:
                    return callAdapter.call(context, self, self);
                case 1:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0));
                case 2:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0), nodes.eltInternal(1));
                case 3:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0), nodes.eltInternal(1), nodes.eltInternal(2));
                default:
                    return callAdapter.call(context, self, self, nodes.toJavaArrayMaybeUnsafe());
            }
View Full Code Here

Examples of org.jruby.RubyArray.eltInternal()

                case 0:
                    return callAdapter.call(context, self, self);
                case 1:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0));
                case 2:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0), nodes.eltInternal(1));
                case 3:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0), nodes.eltInternal(1), nodes.eltInternal(2));
                default:
                    return callAdapter.call(context, self, self, nodes.toJavaArrayMaybeUnsafe());
            }
View Full Code Here

Examples of org.jruby.RubyArray.eltInternal()

                case 1:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0));
                case 2:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0), nodes.eltInternal(1));
                case 3:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0), nodes.eltInternal(1), nodes.eltInternal(2));
                default:
                    return callAdapter.call(context, self, self, nodes.toJavaArrayMaybeUnsafe());
            }
        }
       
View Full Code Here

Examples of org.jruby.RubyArray.eltInternal()

                case 1:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0));
                case 2:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0), nodes.eltInternal(1));
                case 3:
                    return callAdapter.call(context, self, self, nodes.eltInternal(0), nodes.eltInternal(1), nodes.eltInternal(2));
                default:
                    return callAdapter.call(context, self, self, nodes.toJavaArrayMaybeUnsafe());
            }
        }
       
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.