Examples of newArray()


Examples of org.aspectj.org.eclipse.jdt.internal.compiler.codegen.CodeStream.newArray()

    codeStream.aload(closureIndex);

    // build the Object[]

    codeStream.generateInlinedValue(nargs - 1);
    codeStream.newArray(new ArrayBinding(classScope.getType(TypeConstants.JAVA_LANG_OBJECT,
        TypeConstants.JAVA_LANG_OBJECT.length), 1, classScope.environment()));

    int index = 0;
    for (int i = 0; i < nargs - 1; i++) {
      TypeBinding type = binding.parameters[i];
View Full Code Here

Examples of org.jnode.vm.facade.VmHeapManager.newArray()

        final VmArrayClass<?> arrCls = vmClass.getArrayClass();
        VmHeapManager hm = heapManager;
        if (hm == null) {
            heapManager = hm = VmUtils.getVm().getHeapManager();
        }
        final Object result = hm.newArray(arrCls, elements);

        // Screen.debug("}");
        return result;
    }
View Full Code Here

Examples of org.jnode.vm.facade.VmHeapManager.newArray()

                    // Trace new char[]
                    VmUtils.getVm().getCounter(currentClass.getName()).add(elements);
                }
            }
        }
        final Object result = hm.newArray(VmType.getPrimitiveArrayClass(atype),
            elements);
        return result;
    }

    /**
 
View Full Code Here

Examples of org.jnode.vm.facade.VmHeapManager.newArray()

    public static Object allocArray(VmType vmClass, int elements) {
        VmHeapManager hm = heapManager;
        if (hm == null) {
            heapManager = hm = VmUtils.getVm().getHeapManager();
        }
        final Object result = hm.newArray((VmArrayClass) vmClass, elements);
        return result;
    }

    /**
     * Throw a classcast exception.
View Full Code Here

Examples of org.jruby.Ruby.newArray()

            InetAddress addr;
            String hostString = hostname.convertToString().toString();
            addr = InetAddress.getByName(hostString);
           
            ret[0] = r.newString(addr.getCanonicalHostName());
            ret[1] = r.newArray();
            ret[3] = r.newString(addr.getHostAddress());
           
            if (addr instanceof Inet4Address) {
                Inet4Address addr4 = (Inet4Address)addr;
                ret[2] = r.newFixnum(RubySocket.AF_INET); //AF_INET
View Full Code Here

Examples of org.jruby.Ruby.newArray()

        if ((flags & NI_NUMERICHOST) == 0) {
            host = addr.getCanonicalHostName();
        } else {
            host = addr.getHostAddress();
        }
        return runtime.newArray(runtime.newString(host), runtime.newString(port));

    }
}// RubySocket
View Full Code Here

Examples of org.jruby.Ruby.newArray()

            if (value.getMetaClass().searchMethod("to_a").getImplementationClass() != runtime.getKernel()) {
                value = value.callMethod(runtime.getCurrentContext(), "to_a");
                if (!(value instanceof RubyArray)) throw runtime.newTypeError("`to_a' did not return Array");
                return (RubyArray)value;
            } else {
                return runtime.newArray(value);
            }
        }
        return (RubyArray)tmp;
    }
View Full Code Here

Examples of org.jruby.Ruby.newArray()

    }

    @JRubyMethod
    public RubyArray declared_classes() {
        Ruby runtime = getRuntime();
        RubyArray result = runtime.newArray();
        Class<?> javaClass = javaClass();
        try {
            Class<?>[] classes = javaClass.getDeclaredClasses();
            for (int i = 0; i < classes.length; i++) {
                if (Modifier.isPublic(classes[i].getModifiers())) {
View Full Code Here

Examples of org.jruby.Ruby.newArray()

    @JRubyMethod(required = 1, rest = true, meta = true)
    public static IRubyObject gethostbyaddr(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
        Ruby runtime = context.getRuntime();
        IRubyObject[] ret = new IRubyObject[4];
        ret[0] = runtime.newString(intoAddress(runtime,args[0].convertToString().toString()).getCanonicalHostName());
        ret[1] = runtime.newArray();
        ret[2] = runtime.newFixnum(2); // AF_INET
        ret[3] = args[0];
        return runtime.newArrayNoCopy(ret);
    }
    @Deprecated
View Full Code Here

Examples of org.jruby.Ruby.newArray()

        try {
            InetAddress addr = InetAddress.getByName(hostname.convertToString().toString());
            Ruby runtime = context.getRuntime();
            IRubyObject[] ret = new IRubyObject[4];
            ret[0] = runtime.newString(addr.getCanonicalHostName());
            ret[1] = runtime.newArray();
            ret[2] = runtime.newFixnum(2); // AF_INET
            ret[3] = runtime.newString(intoString(runtime,addr));
            return runtime.newArrayNoCopy(ret);
        } catch(UnknownHostException e) {
            throw sockerr(context.getRuntime(), "gethostbyname: name or service not known");
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.