Examples of NativeArray


Examples of jdk.nashorn.internal.objects.NativeArray

        }
        if (so.has("column")) {
          column = ((Double) so.get("column")).intValue();
        }
        if (so.has("extract")) {
          NativeArray extract = (NativeArray) so.get("extract");
          for (int i = 0; i < extract.size(); i++) {
            if (extract.get(i) instanceof String) {
              extractList.add(((String) extract.get(i))
                  .replace("\t", " "));
            }
          }
        }
      } else {
View Full Code Here

Examples of js.lang.NativeArray

            for (String id : object.keySet()) {
                String key = id.toString();
                Object value = object.get(id);

                if (value instanceof List) {
                    java.setProperty(key, parse(new NativeArray(), value));
                } else if (value instanceof Map) {
                    java.setProperty(key, parse(new NativeObject(), value));
                } else if (value instanceof Double) {
                    java.setProperty(key, new NativeNumber((double) value));
                } else {
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.NativeArray

        TestsResult result = new TestsResult();

        executeTimer();

        ScriptResult scriptResult = page.executeJavaScript("window.simulationContext.results");
        NativeArray array = (NativeArray) scriptResult.getJavaScriptResult();

        for (int i = 0; i < array.getLength(); i++) {
            NativeObject object = (NativeObject) array.get(i, array);
            String data = null;
            Object dataObject = object.get("data", object);

            if (!(dataObject instanceof Undefined)) {
                data = (String) dataObject;
View Full Code Here

Examples of org.mozilla.javascript.NativeArray

                    }
                }
            }
            return ht;
        } else if (arg instanceof NativeArray) {
            NativeArray na = (NativeArray) arg;
            Number n = (Number) na.get("length", na);
            int l = n.intValue();
            Vector retval = new Vector(l);
            for (int i=0; i<l; i++) {
                retval.add(i, processXmlRpcResponse(na.get(i, na)));
            }
            return retval;
        } else if (arg instanceof Map) {
            Map map = (Map) arg;
            Hashtable ht = new Hashtable(map.size()*2);
 
View Full Code Here

Examples of org.mozilla.javascript.NativeArray

        } else if (items.size()==1 && !isMulti) {
            return items.iterator().next();

        } else {
            NativeArray result = new NativeArray(items.toArray());
            ScriptRuntime.setObjectProtoAndParent(result, this);
            return result;
        }
    }
View Full Code Here

Examples of org.mozilla.javascript.NativeArray

   
    Emmet jse = Emmet.getSingleton();
    Scriptable tabstopData = (Scriptable) jse.execJSFunction("javaExtractTabstops", text);
    if (tabstopData != null) {
      text = Context.toString(ScriptableObject.getProperty(tabstopData, "text"));
      NativeArray tabstops = (NativeArray) ScriptableObject.getProperty(tabstopData, "tabstops");
      NativeObject tabstopItem;
      for (int i = 0; i < tabstops.getLength(); i++) {
        tabstopItem = (NativeObject) ScriptableObject.getProperty(tabstops, i);
        addTabStopToGroup(
            Context.toString(ScriptableObject.getProperty(tabstopItem, "group")),
            (int) Context.toNumber(ScriptableObject.getProperty(tabstopItem, "start")),
            (int) Context.toNumber(ScriptableObject.getProperty(tabstopItem, "end")));
View Full Code Here

Examples of org.mozilla.javascript.NativeArray

        TestsResult result = new TestsResult();

        executeTimer();

        ScriptResult scriptResult = page.executeJavaScript("window.simulationContext.results");
        NativeArray array = (NativeArray) scriptResult.getJavaScriptResult();

        for (int i = 0; i < array.getLength(); i++) {
            NativeObject object = (NativeObject) array.get(i, array);
            String data = null;
            Object dataObject = object.get("data", object);

            if (!(dataObject instanceof Undefined)) {
                data = (String) dataObject;
View Full Code Here

Examples of org.mozilla.javascript.NativeArray

            cl.clear();
            cl.addAll(java.util.Arrays.asList(values));
        } else if (property instanceof NativeArray) {
            Context.enter();
            try {
                NativeArray arr = (NativeArray) property;

                ScriptableObject.putProperty(arr, "length", new Integer(0));
                ScriptableObject.putProperty(arr, "length",
                                             new Integer(values.length));
                for (int i = 0; i<values.length; i++) {
View Full Code Here

Examples of org.mozilla.javascript.NativeArray

        }
        Object result = jxcontext_.getValue(xpath);

        if (result instanceof NativeArray) {
            // Convert JavaScript array to Collection
            NativeArray arr = (NativeArray) result;
            int len = (int) arr.jsGet_length();
            List list = new ArrayList(len);

            for (int i = 0; i<len; i++) {
                Object obj = arr.get(i, arr);

                if (obj==Context.getUndefinedValue()) {
                    obj = null;
                }
                list.add(obj);
View Full Code Here

Examples of org.mozilla.javascript.NativeArray

            cl.clear();
            cl.addAll(java.util.Arrays.asList(values));
        } else if (property instanceof NativeArray) {
            Context.enter();
            try {
                NativeArray arr = (NativeArray) property;

                ScriptableObject.putProperty(arr, "length", new Integer(0));
                ScriptableObject.putProperty(arr, "length",
                                             new Integer(values.length));
                for (int i = 0; i<values.length; 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.