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; }
/** * 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; }
@Override public Integer get( final int index ) { return _data.get( index ); }
private static void setWord(JsArrayInteger array, int index, int value) { // keep 0s out of the array if (value == 0) { deleteWord(array, index); } else { array.set(index, value); } }
newlySelectedRows.add(i); if (!wasSelected) { modifiedRows.push(i); modifiedRows.push(i); modifiedRows.push(i); if (modifiedRows.length() > 0 && keyboardRowChanged) { modifiedRows.push(oldState.getKeyboardSelectedRow()); modifiedRows.push(newState.keyboardSelectedRow); modifiedRows.push(oldState.getKeyboardSelectedRow()); modifiedRows.push(newState.keyboardSelectedRow);
/** * Create a {@link Uint8ClampedArray} instance from a JavaScript array * containing integers. * * @param array JavaScript array object * @return {@link Uint8ClampedArray} instance */ public static Uint8ClampedArray create(JsArrayInteger array) { int len = array.length(); Uint8ClampedArray result = create(ArrayBufferNative.create(len), 0, len); JsUtils.set(result, array); return result; }
public void push(int value) { if(GWT.isScript()) { stackNative.push(value); } else { stackJava.add(value); } }
public FastArrayShort() { if(GWT.isScript()) { stackNative = JsArrayInteger.createArray().cast(); } else { stackJava = new JsList<Short>(); } }
/** * Convert each element of the array to a String and join them with a comma * separator. The value returned from this method may vary between browsers * based on how JavaScript values are converted into strings. */ public final native String join(String separator) /*-{ return this.join(separator); }-*/;
@Override public Integer next() { return _set._data.get( _offset++ ); }
private static void setWord(JsArrayInteger array, int index, int value) { // keep 0s out of the array if (value == 0) { deleteWord(array, index); } else { array.set(index, value); } }
newlySelectedRows.add(i); if (!wasSelected) { modifiedRows.push(i); modifiedRows.push(i); modifiedRows.push(i); if (modifiedRows.length() > 0 && keyboardRowChanged) { modifiedRows.push(oldState.getKeyboardSelectedRow()); modifiedRows.push(newState.keyboardSelectedRow); modifiedRows.push(oldState.getKeyboardSelectedRow()); modifiedRows.push(newState.keyboardSelectedRow);
@Override public int size() { return _data.length(); } }
public void push(short value) { if(GWT.isScript()) { stackNative.push(value); } else { stackJava.add(value); } }
public FastArrayInteger(){ if(GWT.isScript()) { stackNative = JsArrayInteger.createArray().cast(); } else { stackJava = new JsList<Integer>(); } }
/** * Convert each element of the array to a String and join them with a comma * separator. The value returned from this method may vary between browsers * based on how JavaScript values are converted into strings. */ public final native String join(String separator) /*-{ return this.join(separator); }-*/;