Script Result Set

Provides a table-like container of rows and columns through which members can be returned.

The rows are equivalent to the node that owns the members. The columns are equivalent to the members' member types.

Write operations that go out of bounds result in an exception, to make sure that all result sets are well-formed.

Invalid read operations return empty arrays or nulls, to allow for iteration processing.

pos = addRow(node) Add a row to the result set. Return the position at which it was added. The node can be passed as a ScriptNode, reference or number.

Raise an exception if the node can not be resolved.

pos = addRows(node[]) Add multiple rows to the result set. Return the position at which the last one was added (or the last position if the array is empty). The node can be passed as a ScriptNode, reference or number.

Raise an exception any of the nodes can not be resolved.

pos = addColumn(node) Add a column to the result set. Return the position at which it was added. The node can be passed as a ScriptNode, ScriptMember, reference or number.

Raise an exception if the node can not be resolved.

If the column is passed as a member, it is silently dropped if the target is null.

pos = addColumns(node[]) Add multiple columns to the result set. Return the position at which the last one was added (or the last position if the array is empty). The node can be passed as a ScriptNode, reference or number.

Raise an exception if any of the nodes can not be resolved.

pos = addMember(rowNumber, columnNumber, ScriptMember) Add a member to the result set. Return the position at which it was added.

The row number and column number must represent rows and columns that have been added. If not, an exception is raised.

pos = addMembers(rowNumber, columnNumber, ScriptMember[]) Add multiple members to the result set. Return the position at which the last one was added.

The row number and column number must represent rows and columns that have been added. If not, an exception is raised.

ScriptNode[] = getRows() Retrieve the owning nodes as an array.
ScriptNode = getRow([rowNumber]) Retrieve a single owning node, by 0-based index. Return null if out of bounds. The default is row 0, which is useful when retrieving a one-row result set.
int = getRowCount() Return the number of owning nodes.
ScriptNode[] = getColumns() Retrieve the member types as an array.
ScriptNode = getColumn([columnNumber]) Retrieve a single member type, by 0-based index. Return null if out of bounds.
ScriptMember[] = getColumnMembers() Retrieve the member types as an array of members. This allows other information associated with the member type, i.e. the value and scale, to be retrieved. This requires that the columns have been passed in as script members, and not just nodes.
ScriptMember = getColumnMember([columnNumber]) Retrieve a single member type member. Return null if out of bounds.
int = getColumnCount() Return the number of member types.
int = getColumnNumber(node) Return the column number for a column identified by node. Return -1 if not found.

This searches for any version of the node.

ScriptMember[] = getMembers(rowNumber, columnNumber) For a row and column combination, retrieve all the members. This will be an array, but may be empty. There are no spaces in the array.
ScriptMember = getMember(rowNumber, columnNumber [,memberNumber]) For a row and column combination, retrieve a single member by position. Default position is 0. This may return null if there is no member, or if the row number or column number is out of bounds.

Note that this is passed a 0-based index to the member array. This is not the same as the member sequence number, which is 1-based and which may not be contiguous.

String = getValue(rowNumber, columnNumber [,memberNumber])

Number = getNodeVersionIdentifierTarget(rowNumber, columnNumber [,memberNumber])

Number = getScale(rowNumber, columnNumber [,memberNumber])

ScriptNode = getTarget(rowNumber, columnNumber [,memberNumber])

Number = getNodeVersionIdentifierTarget(rowNumber, columnNumber [,memberNumber]);

ScriptNode[] = getTargets(rowNumber, columnNumber)

 

Convenience methods for returning different parts of the members.

getTargets() returns a list of targets from the list of members, but only for members that have targets. Note that the method is getTargets(), not listTargets().

int = getMemberCount(rowNumber,columnNumber) Return the number of members for a row and column combination.

The script result set also supports the standard error fields.