Package com.google.gwt.core.client

Examples of com.google.gwt.core.client.JsArrayNumber


//  }
 
  public static JsArrayNumber toJsArray(double[]a) {
    if(a==null)
      return null;
    JsArrayNumber jsa = (JsArrayNumber) JsArrayNumber.createArray();
    for (int i = 0; i < a.length; i++) {
      jsa.push(a[i]);
    }
    return jsa;
  }
View Full Code Here


    public void addColumn(String title) {
      columns.set(columns.length(), title);
    }

    public void setValue(int row, int col, double val) {
      JsArrayNumber arr = data.get(col);
      if (arr == null) {
        arr = JsArrayNumber.createArray().cast();
        data.set(col, arr);
      }
      arr.set(row, val);
    }
View Full Code Here

        // Window.alert("Got message as string: " + event.getBody());
        assertFalse("!isMessageNumber()", event.isMessageNumber());
        assertFalse("!isMessageString()", event.isMessageString());
        assertTrue("isMessageObject()", event.isMessageObject());
        assertFalse("!isMessageBoolean()", event.isMessageBoolean());
        JsArrayNumber result = event.getBodyArrayNumber();
        assertEquals("length of array", 4, result.length());
        assertEquals("array[0]", 1.1, result.get(0));
        assertEquals("array[1]", 2.2, result.get(1));
        assertEquals("array[2]", 3.3, result.get(2));
        assertEquals("array[3]", 4.4, result.get(3));
        finishTest();
      }
    });
    wp.sendMessage("arrayNumber", workerID);
  }
View Full Code Here

   *
   * @param array the array containing values
   * @return a corresponding JsArrayNumber
   */
  public static JsArrayNumber createArray(double... array) {
    JsArrayNumber jsArray = JsArray.createArray().cast();
    for (int i = 0; i < array.length; i++) {
      jsArray.set(i, array[i]);
    }
    return jsArray;
  }
View Full Code Here

    }
    return result;
  }

  public static JsArrayNumber wrapArray(float[] srcArray) {
    JsArrayNumber result = JavaScriptObject.createArray().cast();
    for (int i = 0; i < srcArray.length; i++) {
      result.set(i, srcArray[i]);
    }
    return result;
  }
View Full Code Here

    }
    return result;
  }

  public static JsArrayNumber wrapArray(double[] srcArray) {
    JsArrayNumber result = JavaScriptObject.createArray().cast();
    for (int i = 0; i < srcArray.length; i++) {
      result.set(i, srcArray[i]);
    }
    return result;
  }
View Full Code Here

    }
    return visitor.visit(event, values);
  }

  private static double apply(LeafFirstTraversalNumber visitor, UiEvent event) {
    final JsArrayNumber values = JsArrayNumber.createArray().cast();
    final JSOArray<UiEvent> children = event.getChildren();
    for (int i = 0, n = children.size(); i < n; ++i) {
      values.push(apply(visitor, children.get(i)));
    }
    return visitor.visit(event, values);
  }
View Full Code Here

        }
        JsoHelper.setAttribute(jsObj, "fields", array);
    }

    public void setVisibleRange(double... values) {
        JsArrayNumber array = JsArrayNumber.createArray().cast();
        for (double value : values) {
            array.push(value);
        }
        _setVisibleRange(array);
    }
View Full Code Here

  public void testCreateJsArray() {
    if (!TypedArrays.isSupported()) {
      // TODO: some way of showing test as skipped in this case?
      return;
    }
    JsArrayNumber src = getJsoArray();
    Uint32Array array = JsUtils.createUint32Array(src);
    validateArrayContents(array, 0);
  }
View Full Code Here

  public void testCreateJsArray() {
    if (!isSupported()) {
      // TODO: some way of showing test as skipped in this case?
      return;
    }
    JsArrayNumber src = getJsoArray();
    Float64Array array = JsUtils.createFloat64Array(src);
    validateArrayContents(array, 0);
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.core.client.JsArrayNumber

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.