Initializing help system before first use

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

method
getDimension ( ) → {insight.enums.EntityDataDimension}

The dimension of this Array entity.

details
Returns:
returns table
Type Description
type
insight.enums.EntityDataDimension
The dimension of this Array entity
Example
examples
var arr = scenario.getArray('INTEGER_ARRAY');
arr.getDimension();
Back to Top
method
getIterator ( sortKeys ) → {InsightArrayIterator}

Retrieve an iterator for the Insight Array.

Parameters:
params
Name Type Argument Default Description
sortKeys
type
boolean
optional  false Flag to use default JavaScript sorting for keys
details
Returns:
returns table
Type Description
type
InsightArrayIterator
Iterator class for the InsightArray
Example
examples
var arr = scenario.getArray('INTEGER_ARRAY');
var iter = arr.getIterator();
while( var valueObject = iter.next() ) {
     var key = valueObject.key;
     var value = valueObject.value;
}
Back to Top
method
getKeys ( ) → {Array.<Array.<PrimitiveType>>}

Gets all the populated (composite) keys.

details
Returns:
returns table
Type Description
type
Array.<Array.<PrimitiveType>>
An array of the composite keys which can be used to fetch values with getValue( compositeKey )
Example
examples
var arr = scenario.getArray('INTEGER_ARRAY');
var keys = arr.getKeys();
Back to Top
method
getName ( ) → {string}

The name of this Array entity.

details
Returns:
returns table
Type Description
type
string
The name of this Array entity
Example
examples
var arr = scenario.getArray('INTEGER_ARRAY');
arr.getName();
Back to Top
method
getValue ( key ) → {PrimitiveType|null|undefined}

Gets the value of the element with the given indices.

Parameters:
params
Name Type Description
key
type
Array.<PrimitiveType> | PrimitiveType
The indices of the array element
details
Returns:
returns table
Type Description
type
PrimitiveType | null | undefined
The value for this key (which can be null), or undefined if the array does not contain the key
Example
examples
array.getValue(["x1", 2, false]);
Back to Top
method
size ( ) → {number}

The size of the array.

details
Returns:
returns table
Type Description
type
number
The size of the array
Example
examples
array.size();
Back to Top
method
toObjectArray ( ) → {Array.<Object.<{key: (Array.<PrimitiveType>|PrimitiveType), value: PrimitiveType}>>}

Converts the Insight Array into an array of plain javascript objects.

details
Returns:
returns table
Type Description
type
Array.<Object.<{key: (Array.<PrimitiveType>|PrimitiveType), value: PrimitiveType}>>
An array of items.
Example
examples
var arr = scenario.getArray('ARRAY1');
arr.toObjectArray(); // e.g. [{key: ['x1', 'y1'], value: '1,1'}, {key: ['x1', 'y2'], value: '1,2'}]
Back to Top

© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.