Interface IJsArray
interface IJsArray
Extends com.amazon.apmf.IStandard
Immutable JavaScript Array.
Each element of the array can be
of any valid JavaScript dynamic type.
Methods
getElementCount()
i32 getElementCount()
Get the number of elements in the array.
Returns
i32
i32
getElementType()
Get the type of the element at this index.JsTypegetElementType(i32index)
Parameters
index
i32 — Required
Returns
JsType
JsType
Throws
OutOfBoundsError— Thrown when attempting to access an element outside the bounds of the array.
isNull()
Check whether the element at this index is null.boolisNull(i32index)
Parameters
index
i32 — Required
Returns
bool
bool
Throws
OutOfBoundsError— Thrown when attempting to access an element outside the bounds of the array.
isUndefined()
boolisUndefined(i32index)
Parameters
index
i32 — Required
Returns
bool
bool
Check whether the element at this index is undefined.
Throws
OutOfBoundsError— Thrown when attempting to access an element outside the bounds of the array.
getString()
stringgetString(i32index)
Parameters
index
i32 — Required
Returns
string
string
Get the string element (in UTF-8 encoding) at this index.
Throws
OutOfBoundsError— Thrown when attempting to access an element outside the bounds of the array.JsTypeMismatchError— Thrown when attempting to get an element of a type, other than String.
getBool()
boolgetBool(i32index)
Parameters
index
i32 — Required
Returns
bool
bool
Get the boolean element at this index.
Throws
OutOfBoundsError— Thrown when attempting to access an element outside the bounds of the array.JsTypeMismatchError— Thrown when attempting to get an element of a type, other than Bool.
getDouble()
doublegetDouble(i32index)
Parameters
index
i32 — Required
Returns
double
double
Get the IEEE 754 double element at this index.
JavaScript NaN is mapped to one of IEEE 754 NaNs.
JavaScript +/- infinities are mapped to
+/- infinities in IEEE 754.
When an Int is retrieved as a Double,
the exact value is preserved, and no exception is thrown.
Throws
OutOfBoundsError— Thrown when attempting to access an element outside the bounds of the array.JsTypeMismatchError— Thrown when attempting to get an element of a type, other than Double or Int.
getInt()
i64getInt(i32index)
Parameters
index
i32 — Required
Returns
i64
i64
Get the signed 64-bit integer element at this index.
Guaranteed to return an integer value that is,
within the following bounds:
Number.MIN_SAFE_INTEGER -(2**53 - 1) and
Number.MAX_SAFE_INTEGER (2**53 - 1).
When a Double is retrieved as an Int,
the value is got after a loss in precision.
However, no exception is thrown.
Throws
OutOfBoundsError— Thrown when attempting to access an element outside the bounds of the array.JsTypeMismatchError— Thrown when attempting to get an element of a type, other than Int or Double.
getArray()
IJsArray*getArray(i32index)
Parameters
index
i32 — Required
Returns
IJsArray*
IJsArray
Get the IJsArray element at this index.
Throws
OutOfBoundsError— Thrown when attempting to access an element outside the bounds of the array.JsTypeMismatchError— Thrown when attempting to get an element of a type, other than Array.
getObject()
IJsObject*getObject(i32index)
Parameters
index
i32 — Required
Returns
IJsObject*
IJsObject
Get the IJsObject element at this index.
Throws
OutOfBoundsError— Thrown when attempting to access an element outside the bounds of the array.JsTypeMismatchError— Thrown when attempting to get an element of a type, other than Object.

