Examples of dataWrapStruct()


Examples of org.jruby.RubyModule.dataWrapStruct()

        holder.history = new History();
        holder.currentCompletor = null;

        RubyModule mReadline = runtime.defineModule("Readline");

        mReadline.dataWrapStruct(holder);

        mReadline.defineAnnotatedMethods(Readline.class);
        IRubyObject hist = runtime.getObject().callMethod(runtime.getCurrentContext(), "new");
        mReadline.fastSetConstant("HISTORY", hist);
        hist.getSingletonClass().includeModule(runtime.getEnumerable());
View Full Code Here

Examples of org.jruby.RubyModule.dataWrapStruct()

        holder.currentCompletor = null;
        COMPLETION_CASE_FOLD = runtime.getNil();

        RubyModule mReadline = runtime.defineModule("Readline");

        mReadline.dataWrapStruct(holder);

        mReadline.defineAnnotatedMethods(Readline.class);
        IRubyObject hist = runtime.getObject().callMethod(runtime.getCurrentContext(), "new");
        mReadline.fastSetConstant("HISTORY", hist);
        hist.getSingletonClass().includeModule(runtime.getEnumerable());
View Full Code Here

Examples of org.jruby.RubyModule.dataWrapStruct()

        rand.defineAnnotatedMethods(Random.class);

        RandomHolder holder = new RandomHolder();
        holder.randomizers = new java.util.Random[]{new java.util.Random(), new SecureRandom()};
        rand.dataWrapStruct(holder);
    }

    @JRubyMethod(meta=true)
    public static IRubyObject seed(IRubyObject recv, IRubyObject arg) {
        return recv.getRuntime().getNil();
View Full Code Here

Examples of org.jruby.RubyModule.dataWrapStruct()

        holder.currentCompletor = null;
        COMPLETION_CASE_FOLD = runtime.getNil();

        RubyModule mReadline = runtime.defineModule("Readline");

        mReadline.dataWrapStruct(holder);

        mReadline.defineAnnotatedMethods(Readline.class);
        IRubyObject hist = runtime.getObject().callMethod(runtime.getCurrentContext(), "new");
        mReadline.setConstant("HISTORY", hist);
        hist.getSingletonClass().includeModule(runtime.getEnumerable());
View Full Code Here

Examples of org.jruby.RubyModule.dataWrapStruct()

        holder.currentCompletor = null;
        COMPLETION_CASE_FOLD = runtime.getNil();

        RubyModule mReadline = runtime.defineModule("Readline");

        mReadline.dataWrapStruct(holder);

        mReadline.defineAnnotatedMethods(Readline.class);
        IRubyObject hist = runtime.getObject().callMethod(runtime.getCurrentContext(), "new");
        mReadline.setConstant("HISTORY", hist);
        hist.getSingletonClass().includeModule(runtime.getEnumerable());
View Full Code Here

Examples of org.jruby.RubyObject.dataWrapStruct()

    @JRubyMethod(name = "new", rest = true, frame = true, meta = true)
    public static IRubyObject new_instance(IRubyObject self, IRubyObject[] args, Block block) {
        // Generator#new
        IRubyObject result = new RubyObject(self.getRuntime(),(RubyClass)self);
        result.dataWrapStruct(new GeneratorData(result));
        result.callMethod(self.getRuntime().getCurrentContext(), "initialize", args, block);
        return result;
    }

    @JRubyMethod(optional = 1, frame = true, visibility = Visibility.PRIVATE)
View Full Code Here

Examples of org.jruby.java.proxies.ArrayJavaProxy.dataWrapStruct()

    public IRubyObject emptyJavaArray(ThreadContext context) {
        JavaArray javaArray = new JavaArray(getRuntime(), Array.newInstance(javaClass(), 0));
        RubyClass proxyClass = (RubyClass)Java.get_proxy_class(javaArray, array_class());
       
        ArrayJavaProxy proxy = new ArrayJavaProxy(context.getRuntime(), proxyClass);
        proxy.dataWrapStruct(javaArray);
       
        return proxy;
    }
  
    public IRubyObject javaArraySubarray(ThreadContext context, JavaArray fromArray, int index, int size) {
View Full Code Here

Examples of org.jruby.java.proxies.ArrayJavaProxy.dataWrapStruct()

            JavaArray javaArray = new JavaArray(getRuntime(), newArray);
            System.arraycopy(fromArray.getValue(), index, newArray, 0, size);
            RubyClass proxyClass = (RubyClass)Java.get_proxy_class(javaArray, array_class());

            ArrayJavaProxy proxy = new ArrayJavaProxy(context.getRuntime(), proxyClass);
            proxy.dataWrapStruct(javaArray);

            return proxy;
        }
    }
  
View Full Code Here

Examples of org.jruby.java.proxies.ArrayJavaProxy.dataWrapStruct()

        System.arraycopy(original.getValue(), 0, newArray, 0, oldLength);
        System.arraycopy(additional.getValue(), 0, newArray, oldLength, addLength);
        RubyClass proxyClass = (RubyClass)Java.get_proxy_class(javaArray, array_class());

        ArrayJavaProxy proxy = new ArrayJavaProxy(context.getRuntime(), proxyClass);
        proxy.dataWrapStruct(javaArray);

        return proxy;
    }
  
    /**
 
View Full Code Here

Examples of org.jruby.java.proxies.ArrayJavaProxy.dataWrapStruct()

        Object newArray = Array.newInstance(javaClass(), oldLength + addLength);
        JavaArray javaArray = new JavaArray(getRuntime(), newArray);
        System.arraycopy(original.getValue(), 0, newArray, 0, oldLength);
        RubyClass proxyClass = (RubyClass)Java.get_proxy_class(javaArray, array_class());
        ArrayJavaProxy proxy = new ArrayJavaProxy(context.getRuntime(), proxyClass);
        proxy.dataWrapStruct(javaArray);
       
        Ruby runtime = context.getRuntime();
        for (int i = 0; i < addLength; i++) {
            RuntimeHelpers.invoke(context, proxy, "[]=", runtime.newFixnum(oldLength + i),
                    RuntimeHelpers.invoke(context, additional, "[]", runtime.newFixnum(i)));
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.