Package org.jruby.java.proxies

Examples of org.jruby.java.proxies.ArrayJavaProxy


        } else {
            if (index + size > actualLength) {
                size = actualLength - index;
            }
           
            ArrayJavaProxy proxy = ArrayUtils.newProxiedArray(context.runtime, fromArray.getClass().getComponentType(), size);
            Object newArray = proxy.getObject();
            System.arraycopy(fromArray, index, newArray, 0, size);

            return proxy;
        }
    }
View Full Code Here


    public static IRubyObject concatArraysDirect(ThreadContext context, Object original, IRubyObject additional) {
        Ruby runtime = context.runtime;
        int oldLength = Array.getLength(original);
        int addLength = (int)((RubyFixnum) Helpers.invoke(context, additional, "length")).getLongValue();
       
        ArrayJavaProxy proxy = ArrayUtils.newProxiedArray(runtime, original.getClass().getComponentType(), oldLength + addLength);
        Object newArray = proxy.getObject();
       
        System.arraycopy(original, 0, newArray, 0, oldLength);

        for (int i = 0; i < addLength; i++) {
            Helpers.invoke(context, proxy, "[]=", runtime.newFixnum(oldLength + i),
View Full Code Here

TOP

Related Classes of org.jruby.java.proxies.ArrayJavaProxy

Copyright © 2018 www.massapicom. 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.