Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Row

A class representing a Row in a Table. Rows may be grouped, and are owned by a single Table. The grouping is traversable via parent, children, and owner.

Hierarchy

  • Row

Index

Constructors

constructor

  • new Row(owner: Table, name: string | null): Row
  • Constructs a new Row, with a given owning table and row name

    Parameters

    • owner: Table

      The table that uniquely owns this row

    • name: string | null

      The name to assign to this row.

    Returns Row

Properties

Private _children

_children: Row[]

Private _name

_name: string

Private _owner

_owner: Table

Private _parent

_parent: Row | null = null

Private _rowData

_rowData: any[]

Accessors

_data

  • get _data(): any[]

children

  • get children(): Row[]
  • The children of this row. If the row is a leaf row, the array is empty.

    type

    {Row[]}

    Returns Row[]

columns

  • get columns(): object
  • Returns a representation of this row as an object keyed on the column names.

    type

    {Object.<string, any>}

    Returns object

    • [key: string]: any

level

  • get level(): number
  • Traverses the parents of this row, returning the total number of parents.

    type

    {number}

    Returns number

name

  • get name(): string
  • The string name of this row, as used in the Row Path.

    type

    {string}

    Returns string

owner

  • The Table that owns this Row. Only one table may own a Row.

    type

    {Table}

    Returns Table

parent

  • get parent(): null | Row
  • The parent Row of this Row, or null if it is a root Row.

    type

    {Row}

    Returns null | Row

Methods

_ensureRowDataLength

  • _ensureRowDataLength(len: number): void
  • Parameters

    • len: number

    Returns void

_ensureRowDataType

  • _ensureRowDataType(columnTypes: Type[]): void
  • Parameters

    • columnTypes: Type[]

    Returns void

Private _indexOrNameToIndex

  • _indexOrNameToIndex(indexOrName: any): number
  • Parameters

    • indexOrName: any

    Returns number

_setParent

  • _setParent(parent: Row | null): void

appendChild

  • appendChild(row: Row): void
  • Appends a child row to this row, setting the child row's parent and updating the length of the owner table. A row must not be parented to both the owner and another row!

    Parameters

    • row: Row

      The row to parent to this row

    Returns void

cloneToTable

getValue

  • getValue(indexOrName: string | number): any
  • Gets the value of a particular column of this row. Columns may be referenced by either the index in the column names, or the string name of the column

    Parameters

    • indexOrName: string | number

      The column to set, or it's index.

    Returns any

    The value of this row at the given column.

insertChild

  • insertChild(row: Row, index: number): void
  • Inserts a child row into the given index

    Parameters

    • row: Row
    • index: number

    Returns void

setName

  • setName(value: any): void
  • Set the row name explicitly

    Parameters

    • value: any

    Returns void

setValue

  • setValue(indexOrName: string | number, value: any): void
  • Sets the value of a particular column of this row. Columns may be referenced either by index or their string name.

    Parameters

    • indexOrName: string | number

      The column to set, or it's index in the owning table's columnNames

    • value: any

      The value to set

    Returns void

Generated using TypeDoc