/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(byte[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(int[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(short[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
public static JsArrayInteger toJsArray(short[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i]); } return jsan; }
public static JsArrayInteger toJsArrayUnsigned(byte[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i] & 255); } return jsan; }
public static JsArrayInteger toJsArray(byte[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i]); } return jsan; }
public static JsArrayInteger toJsArray(int[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i]); } return jsan; }
public static JsArrayInteger toJsArray(int[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i]); } return jsan; }
public static JsArrayInteger toJsArray(byte[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i]); } return jsan; }
public static JsArrayInteger toJsArray(int[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i]); } return jsan; }
public static JsArrayInteger toJsArray(short[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i]); } return jsan; }
public static JsArrayInteger toJsArrayUnsigned(short[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i] & 65535); } return jsan; }
public static JsArrayInteger toJsArray(short[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i]); } return jsan; }
public static JsArrayInteger toJsArrayUnsigned(short[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i] & 65535); } return jsan; }
public static JsArrayInteger toJsArray(byte[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i]); } return jsan; }
public static JsArrayInteger toJsArrayUnsigned(byte[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i] & 255); } return jsan; }
public static JsArrayInteger toJsArrayUnsigned(short[] data) { JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray(); int len = data.length; for (int i = len - 1; i >= 0; i--) { jsan.set(i, data[i] & 65535); } return jsan; }
public void setHiddenDays(final int... days) { if (days != null) { final JsArrayInteger intArr = (JsArrayInteger) JsArrayInteger.createArray(); for (final int i : days) { assert i >= 0 && i <= 6; intArr.push(i); } setHiddenDays(intArr); } }
/** * Array of keycodes which will add a tag when typing in the input. * (default: [13, 188], which are ENTER and comma) * * @param confirmKeys Array of keycodes */ public void setConfirmKeys(final List<Integer> confirmKeys) { JsArrayInteger keys = JsArrayInteger.createArray().cast(); for(int key : confirmKeys) { keys.push(key); } options.setConfirmKeys(keys); }
public FastArrayShort() { if(GWT.isScript()) { stackNative = JsArrayInteger.createArray().cast(); } else { stackJava = new JsList<Short>(); } }