InsightArrayIterator
Method summary
name | description |
---|---|
moveBefore | Set the cursor position. |
moveBeforeFirst | Resets the iterator back to the start. |
next | Retrieves the next element in the Insight Array. |
Methods
- moveBefore ( ) → {InsightArrayIterator}
-
Position the cursor so that the next element returned will be the one specified by the passed in key. If the key does not exist then there is no change to the cursor position.
Returns:Type Description InsightArrayIterator the iterator to allow chaining commands Example
Back to Topvar key = [4]; // 4th item var arr = scenario.getArray('INTEGER_ARRAY'); array.moveBefore(key); array.next(); // fourth item returned
- moveBeforeFirst ( ) → {InsightArrayIterator}
-
Resets the iterator back to the start.
Returns:Type Description InsightArrayIterator the iterator to allow chaining commands Example
Back to Topvar arr = scenario.getArray('INTEGER_ARRAY'); array.next(); // first item array.next(); // second item array.next(); // third item array.moveBeforeFirst(); // reset the cursor array.next(); // first item array.next(); // second item
- next ( ) → {Object.<{key: Array.<(string|number|boolean)>, value: (string|number|boolean)}>|undefined}
-
Retrieves the next element in the Insight Array.
Returns:Type Description Object.<{key: Array.<(string|number|boolean)>, value: (string|number|boolean)}> | undefined Undefined if end of data Example
Back to Topvar arr = scenario.getArray('INTEGER_ARRAY'); var keyValueObject; while (keyValueObject = array.next()) { // do something with value }
© 2001-2024 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.