Examples of JsArrayInteger


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

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

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

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

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

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

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

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

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

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

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

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

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

  public void testCalculateModifiedRanges() {
    HasData<String> listView = new MockHasData<String>();
    MockView<String> view = new MockView<String>();
    HasDataPresenter<String> presenter = new HasDataPresenter<String>(listView, view, 10, null);

    JsArrayInteger rows = JavaScriptObject.createArray().cast();

    // Empty set of rows.
    assertListContains(presenter.calculateModifiedRanges(rows, 0, 10));

    // One row in range.
    rows.push(5);
    assertListContains(presenter.calculateModifiedRanges(rows, 0, 10), new Range(5, 1));

    // One row not in range.
    assertListContains(presenter.calculateModifiedRanges(rows, 6, 10));

    // Consecutive rows (should return only one range).
    rows.push(6);
    rows.push(7);
    rows.push(8);
    assertListContains(presenter.calculateModifiedRanges(rows, 0, 10), new Range(5, 4));

    // Disjoint rows. Should return two ranges.
    rows.push(10);
    rows.push(11);
    assertListContains(presenter.calculateModifiedRanges(rows, 0, 20), new Range(5, 4), new Range(
        10, 2));

    // Multiple gaps. The largest gap should be between the two ranges.
    rows.push(15);
    rows.push(17);
    assertListContains(presenter.calculateModifiedRanges(rows, 0, 20), new Range(5, 7), new Range(
        15, 3));
  }
View Full Code Here

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

    public static native void throwJavaScriptObject(JavaScriptObject err) /*-{
        throw err;
    }-*/;
   
    public static JsArrayInteger toIntegerArray(byte... bytes) {
        JsArrayInteger ret = JavaScriptObject.createArray().cast();
        for (byte byt : bytes) {
            ret.push(byt);
        }
        return ret;
    }
View Full Code Here

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

        bytes[pos++] = (byte) (v & 0xFF);
    }

    public void writeFloat(float v) throws IOException {
        growToFit(4);
        JsArrayInteger bytes = IEEE754.fromFloat(v);
        for (int i = 0; i < 4; i++) {
            this.bytes[pos++] = (byte)bytes.get(i);
        }
    }
View Full Code Here

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

        }
    }

    public void writeDouble(double v) throws IOException {
        growToFit(8);
        JsArrayInteger bytes = IEEE754.fromDouble(v);
        for (int i = 0; i < 8; i++) {
            this.bytes[pos++] = (byte)bytes.get(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.