public class JsArrayUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static JsArrayInteger |
readOnlyJsArray(byte[] array)
Take a Java array, and produce a JS array that is only used for reading.
|
static JsArrayNumber |
readOnlyJsArray(double[] array)
Take a Java array, and produce a JS array that is only used for reading.
|
static JsArrayNumber |
readOnlyJsArray(float[] array)
Take a Java array, and produce a JS array that is only used for reading.
|
static JsArrayInteger |
readOnlyJsArray(int[] array)
Take a Java array, and produce a JS array that is only used for reading.
|
static JsArrayNumber |
readOnlyJsArray(long[] array)
Take a Java array, and produce a JS array that is only used for reading.
|
static JsArrayInteger |
readOnlyJsArray(short[] array)
Take a Java array, and produce a JS array that is only used for reading.
|
static <T extends JavaScriptObject> |
readOnlyJsArray(T[] array)
Take a Java array, and produce a JS array that is only used for reading.
|
public static JsArrayInteger readOnlyJsArray(byte[] array)
array
- source arraypublic static JsArrayNumber readOnlyJsArray(double[] array)
array
- source arraypublic static JsArrayNumber readOnlyJsArray(float[] array)
array
- source arraypublic static JsArrayInteger readOnlyJsArray(int[] array)
array
- source arraypublic static JsArrayNumber readOnlyJsArray(long[] array)
NOTE: long values are not supported in JS, so long emulation is slow and this method assumes that all the values can be safely stored in a double.
array
- source array - its values are assumed to be in the valid range
for doubles -- if the values exceed 2^53, low-order bits will be lostpublic static JsArrayInteger readOnlyJsArray(short[] array)
array
- source arraypublic static <T extends JavaScriptObject> JsArray<T> readOnlyJsArray(T[] array)
array
- source array