InsightArray
Method summary
name | description |
---|---|
getDimension | The dimension of this Array entity. |
getIterator | Retrieve an iterator for the Insight Array. |
getKeys | Gets all the populated (composite) keys. |
getName | The name of this Array entity. |
getValue | Gets the value of the element with the given indices. |
size | The size of the array. |
toObjectArray | Converts the Insight Array into an array of plain javascript objects. |
Methods
- getDimension ( ) → {insight.enums.EntityDataDimension}
-
The dimension of this Array entity.
detailsReturns:returns tableType Description typeinsight.enums.EntityDataDimensionThe dimension of this Array entity Example
examples
Back to Topvar arr = scenario.getArray('INTEGER_ARRAY'); arr.getDimension();
- getIterator ( sortKeys ) → {InsightArrayIterator}
-
Retrieve an iterator for the Insight Array.
Parameters:
paramsName Type Argument Default Description sortKeys typebooleanoptional false Whether to sort array keys. This will use any set comparators assigned to index sets, otherwise it will fallback to default sorting based on index set data type. Warning, this is likely to reduce performance on large arrays. detailsReturns:returns tableType Description typeInsightArrayIteratorIterator class for the InsightArray Example
examples
Back to Topvar arr = scenario.getArray('INTEGER_ARRAY'); var iter = arr.getIterator(); while( var valueObject = iter.next() ) { var key = valueObject.key; var value = valueObject.value; }
- getKeys ( ) → {Array.<Array.<PrimitiveType>>}
-
Gets all the populated (composite) keys.
detailsReturns:returns tableType Description typeArray.<Array.<PrimitiveType>>An array of the composite keys which can be used to fetch values with getValue( compositeKey ) Example
examples
Back to Topvar arr = scenario.getArray('INTEGER_ARRAY'); var keys = arr.getKeys();
- getName ( ) → {string}
-
The name of this Array entity.
detailsReturns:returns tableType Description typestringThe name of this Array entity Example
examples
Back to Topvar arr = scenario.getArray('INTEGER_ARRAY'); arr.getName();
- getValue ( key ) → {PrimitiveType|null|undefined}
-
Gets the value of the element with the given indices.
Parameters:
paramsName Type Description key typeArray.<PrimitiveType> | PrimitiveTypeThe indices of the array element detailsReturns:returns tableType Description typePrimitiveType | null | undefinedThe value for this key (which can be null), or undefined if the array does not contain the key Example
examples
Back to Toparray.getValue(["x1", 2, false]);
- size ( ) → {number}
-
The size of the array.
detailsReturns:returns tableType Description typenumberThe size of the array Example
examples
Back to Toparray.size();
- toObjectArray ( sortKeys ) → {Array.<Object.<{key: (Array.<PrimitiveType>|PrimitiveType), value: PrimitiveType}>>}
-
Converts the Insight Array into an array of plain javascript objects.
Parameters:
paramsName Type Argument Default Description sortKeys typebooleanoptional false Whether to sort array keys. This will use any set comparators assigned to index sets, otherwise it will fallback to default sorting based on index set data type. Warning, this is likely to reduce performance on large arrays. detailsReturns:returns tableType Description typeArray.<Object.<{key: (Array.<PrimitiveType>|PrimitiveType), value: PrimitiveType}>>An array of items. Example
examples
Back to Topvar arr = scenario.getArray('ARRAY1'); arr.toObjectArray(); // e.g. [{key: ['x1', 'y1'], value: '1,1'}, {key: ['x1', 'y2'], value: '1,2'}]
method
method
method
method
method
method
method