Examples of JsArrayInteger


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

   */
  public static JsArrayInteger wrapArray(int[] srcArray) {
    if (GWT.isScript()) {
      return arrayAsJsArrayForProdMode(srcArray);
    }
    JsArrayInteger result = JavaScriptObject.createArray().cast();
    for (int i = 0; i < srcArray.length; i++) {
      result.set(i, srcArray[i]);
    }
    return result;
  }
View Full Code Here

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

    return "com.google.gwt.typedarrays.TypedArrays";
  }

  public void testSetAndGetLong() {
    long[] array = new long[] {0, 1, 2, 3, 4294967295L, 4294967294L, 4294967293L, 4294967292L};
    JsArrayInteger jsArray = JsArrayInteger.createArray().cast();

    for (int i = 0; i < array.length; i++) {
      JsArrayUtil.setLongToJsArrayInteger(jsArray, i, array[i]);
    }
View Full Code Here

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

    }
  }

  public void testWrapByte() {
    byte[] array = new byte[] {0, 1, 2, 3, Byte.MAX_VALUE, Byte.MIN_VALUE};
    JsArrayInteger wrappedArray = JsArrayUtil.wrapArray(array);

    assertEquals(array.length, wrappedArray.length());

    for (int i = 0; i < array.length; i++) {
      assertEquals(array[i], wrappedArray.get(i));
    }
  }
View Full Code Here

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

    }
  }
 
  public void testWrapShort() {
    short[] array = new short[] {0, 1, 2, 3, Short.MAX_VALUE, Short.MIN_VALUE};
    JsArrayInteger wrappedArray = JsArrayUtil.wrapArray(array);
   
    assertEquals(array.length, wrappedArray.length());
   
    for (int i = 0; i < array.length; i++) {
      assertEquals(array[i], wrappedArray.get(i));
    }
  }
View Full Code Here

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

    }
  }

  public void testWrapInt() {
    int[] array = new int[] {0, 1, 2, 3, Integer.MAX_VALUE, Integer.MIN_VALUE};
    JsArrayInteger wrappedArray = JsArrayUtil.wrapArray(array);

    assertEquals(array.length, wrappedArray.length());

    for (int i = 0; i < array.length; i++) {
      assertEquals(array[i], wrappedArray.get(i));
    }
  }
View Full Code Here

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

  }

  public void testWrapLong() {
    // we are only interested in values that are used by the Uint32Integer
    long[] array = new long[] {0, 1, 2, 3, 4294967295L, 4294967294L, 4294967293L, 4294967292L};
    JsArrayInteger wrappedArray = JsArrayUtil.wrapArray(array);

    assertEquals(array.length, wrappedArray.length());

    assertTrue(checkLongArrayContents(wrappedArray));
  }
View Full Code Here

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

  public String toString() {
    return "rgb(" + red + "," + green + "," + blue + ")";
  }

  public void setHex(String hexColor) {
    JsArrayInteger rgb = hexToRgb(hexColor);
    this.red = rgb.get(0);
    this.green = rgb.get(1);
    this.blue = rgb.get(2);
  }
View Full Code Here

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

  public String toString() {
    return "rgb(" + red + "," + green + "," + blue + ")";
  }

  public void setHex(String hexColor) {
    JsArrayInteger rgb = hexToRgb(hexColor);
    this.red = rgb.get(0);
    this.green = rgb.get(1);
    this.blue = rgb.get(2);
  }
View Full Code Here

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

  }
  public static JsArrayInteger fromArray(int... values) {
    if (GWT.isScript()) {
      return reinterpretCast(values);
    } else {
      JsArrayInteger ret = JavaScriptObject.createArray().cast();
      for (int i = 0, l = values.length; i < l; i++) {
        ret.set(i, values[i]);
      }
      return ret;
    }
  }
View Full Code Here

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

  }
  public static JsArrayInteger fromArray(int... values) {
    if (GWT.isScript()) {
      return reinterpretCast(values);
    } else {
      JsArrayInteger ret = JavaScriptObject.createArray().cast();
      for (int i = 0, l = values.length; i < l; i++) {
        ret.set(i, values[i]);
      }
      return ret;
    }
  }
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.