Skip to content

Latest commit

 

History

History
193 lines (127 loc) · 3.57 KB

table.adoc

File metadata and controls

193 lines (127 loc) · 3.57 KB

Table

Represents table object (usually it’s value of table DCI).

Instance attributes

columnCount ⇒ Integer

Number of columns.

columns ⇒ Array<TableColumn>

Array of column definitions.

instanceColumns ⇒ Array<TableColumn>

Array of column definitions including only columns marked as instance columns.

instanceColumnIndexes ⇒ Array<Integer>

Array with indexes of columns marked as instance columns.

rowCount ⇒ Integer

Number of rows.

rows ⇒ Array<TableRow>

Array of rows with data.

title ⇒ String

Title of table.

Instance methods

addColumn(name, [type], [displayName], [isInstance]) ⇒ Integer

Adds column to table

Table 1. Parameters

name

String

Column name

type

Integer

Data type, optional parameter. Default is String

displayName

String

Column display name

isInstance

Boolean

True if column is instance column

Return

Column index

addRow() ⇒ Integer

Adds row to table

Return

Row index

deleteColumn(columnId) ⇒ void

Delete column

Table 2. Parameters

columnId

Integer

Column index

deleteRow(rowId) ⇒ void

Delete row

Table 3. Parameters

rowId

Integer

Row index

findRowByInstance(instance, instance2, …​) ⇒ [class-tablerow]

Finds row by instance

Table 4. Parameters

instance

String

Instance string

instance2

String

Optional. If instance is composed of several columns, these can be supplied as additional parameters.

Return

Table row that corresponds to provided instance

findRowIndexByInstance(instance, instance2, …​) ⇒ Integer

Finds row index by instance

Table 5. Parameters

instance

String

Instance string

instance2

String

Optional. If instance is composed of several columns, these can be supplied as additional parameters.

Return

Table row index corresponds to provided instance

get(rowId, columnId) ⇒ String

Get cell value by row and column id

Table 6. Parameters

rowId

Integer

Row index

columnId

Integer

Column index

Return

Cell value as string

getColumnIndex(columnName) ⇒ Integer

Get column index by column name

Table 7. Parameters

columnName

String

Column name

Return

Column name

getColumnName(columnId) ⇒ String

Get column name by column index

Table 8. Parameters

columnName

Integer

Column name

Return

Column index

print() ⇒ String

Prints the whole table with it’s content and header

Return

String with formatted table

set(rowId, columnId, value) ⇒ void

Set column value by row and column index

Table 9. Parameters

rowId

Integer

Row index

columnId

Integer

Column index

value

String

New value

Return

Column index

trace(tag, level, prefix, headers, delimiter) ⇒ void

Dump table to log

Table 10. Parameters

tag

String

Target debug level, default "nxsl.trace"

level

Integer

Target debug level, default "0"

prefix

String

Optional target prefix; will be added before each line in log file, default 'NULL'

headers

Bolean

Optional target header, default 'true'

delimiter

String

Optional record separator, default ','

Constructors

Table()

Creates new Table object.