Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TableAccessor

Allows random access to the values in a {@link com.bayesserver.Table}, using a preferred variable ordering, as opposed to the default sorted order specified in {@link com.bayesserver.Table#getSortedVariables}.

see

com.bayesserver.TableIterator

see

com.bayesserver.Table

Hierarchy

  • TableAccessor

Index

Constructors

constructor

  • Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables.

    see

    com.bayesserver.TableIterator

    exception

    ReferenceError Raised if either [table] or [order] is null.

    exception

    Error Raised if order does not contain the same variables as [table].

    Parameters

    • table: Table

      The table whose values are to be accessed.

    • order: IList<Variable>

      The order in which the variables should be accessed. The last variable's states toggle fastest.

    Returns TableAccessor

  • Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables.

    see

    com.bayesserver.TableIterator

    exception

    ReferenceError Raised if either [table] or [order] is null.

    exception

    Error Raised if order does not contain the same variables as [table].

    Parameters

    • table: Table

      The table whose values are to be accessed.

    • order: Variable[]

      The order in which the variables should be accessed. The last variable's states toggle fastest.

    Returns TableAccessor

  • Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables. Any times that are contained within the {@link com.bayesserver.VariableContextCollection} will be used. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables at specified times. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables at specified times. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables.

    Parameters

    • table: Table

      The table whose values are to be accessed.

    • order: IList<VariableContext>

      The order in which the variables should be accessed. The last variable's states toggle fastest.

    Returns TableAccessor

  • Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables. Any times that are contained within the {@link com.bayesserver.VariableContextCollection} will be used. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables at specified times. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables at specified times. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables. Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables.

    Parameters

    • table: Table

      The table whose values are to be accessed.

    • order: VariableContext[]

      The order in which the variables should be accessed. The last variable's states toggle fastest.

    Returns TableAccessor

  • Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables. Any times that are contained within the {@link com.bayesserver.VariableContextCollection} will be used.

    exception

    ReferenceError Raised if either [table] or [order] is null.

    exception

    Error Raised if order does not contain the same variables as [table].

    Parameters

    • table: Table

      The table whose values are to be accessed.

    • order: VariableContextCollection

      The order in which the variables should be accessed. The last variable's states toggle fastest.

    Returns TableAccessor

  • Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables.

    exception

    ReferenceError Raised if either [table] or [order] is null.

    exception

    Error Raised if the nodes in order do not contain the same variables as [table].

    Parameters

    • table: Table

      The table whose values are to be accessed.

    • order: IList<Node>

      The order in which the variables should be accessed. The last variable's states toggle fastest.

    • times: IList<number | null>

      The times for the node variables.

    Returns TableAccessor

  • Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables.

    exception

    ReferenceError Raised if either [table] or [order] is null.

    exception

    Error Raised if the nodes in order do not contain the same variables as [table].

    Parameters

    • table: Table

      The table whose values are to be accessed.

    • order: Node[]

      The order in which the variables should be accessed. The last variable's states toggle fastest.

    • times: number[]

      The times for the node variables.

    Returns TableAccessor

  • Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables at specified times.

    exception

    ReferenceError Raised if either [table] or [order] is null.

    exception

    Error Raised if order does not contain the same variables as [table].

    Parameters

    • table: Table

      The table whose values are to be accessed.

    • order: Variable[]

      The order in which the variables should be accessed. The last variable's states toggle fastest.

    • times: number[]

      The times for the node variables.

    Returns TableAccessor

  • Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the variables at specified times.

    exception

    ReferenceError Raised if either [table] or [order] is null.

    exception

    Error Raised if order does not contain the same variables as [table].

    Parameters

    • table: Table

      The table whose values are to be accessed.

    • order: IList<Variable>

      The order in which the variables should be accessed. The last variable's states toggle fastest.

    • times: IList<number | null>

      The times for the node variables.

    Returns TableAccessor

  • Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables.

    see

    com.bayesserver.TableIterator

    exception

    ReferenceError Raised if either [table] or [order] is null.

    exception

    Error Raised if the nodes in order do not contain the same variables as [table].

    Parameters

    • table: Table

      The table whose values are to be accessed.

    • order: IList<Node>

      The order in which the variables should be accessed. The last variable's states toggle fastest.

    Returns TableAccessor

  • Initializes a new instance of the {@link com.bayesserver.TableAccessor} class, allowing random access to [table] with a specified [order] for the node variables.

    see

    com.bayesserver.TableIterator

    exception

    ReferenceError Raised if either [table] or [order] is null.

    exception

    Error Raised if the nodes in order do not contain the same variables as [table].

    Parameters

    • table: Table

      The table whose values are to be accessed.

    • order: Node[]

      The order in which the variables should be accessed. The last variable's states toggle fastest.

    Returns TableAccessor

Accessors

size

  • get size(): number
  • Gets the count of values in the underlying {@link com.bayesserver.Table}.

    Returns number

    The count.

table

  • Gets the underlying {@link com.bayesserver.Table}.

    Returns Table

    The underlying {@link com.bayesserver.Table}.

Methods

copyFrom

  • copyFrom(values: number[]): void
  • Copies values from an array into the underlying {@link com.bayesserver.Table} using the variable ordering of the {@link com.bayesserver.TableAccessor}, not the {@link com.bayesserver.Table#getSortedVariables}.

    exception

    ReferenceError Raised if [values] is null.

    exception

    Error Raised if [values] is too short.

    Parameters

    • values: number[]

      An array of values to copy.

    Returns void

get

  • get(states: number[]): number
  • get(i: number): number
  • Gets the underlying {@link com.bayesserver.Table} value, using states corresponding to the order of variables in the {@link com.bayesserver.TableAccessor}.

    Parameters

    • states: number[]

    Returns number

    The underlying {@link com.bayesserver.Table} value.

  • Gets the underlying {@link com.bayesserver.Table} value, specified i.

    Parameters

    • i: number

    Returns number

    The table value.

getRow

  • getRow(states: number[]): number
  • Gets the {@link com.bayesserver.TableAccessor} row for the given states. The row is relative to the specified variable ordering in the {@link com.bayesserver.TableAccessor}.

    exception

    ReferenceError [states] is null.

    exception

    Error [states] length does not equal the number of variables in the {@link com.bayesserver.TableAccessor}.

    Parameters

    • states: number[]

      The states.

    Returns number

    The corresponding row in the {@link com.bayesserver.TableAccessor}.

getState

  • getState(i: number, node: number): number
  • Gets the state at the given position [i] for the node given by [node]. The position is relative to the specified variable ordering in the {@link com.bayesserver.TableAccessor}.

    Parameters

    • i: number

      The position at which to retrieve the state.

    • node: number

      The node.

    Returns number

    The state.

getStates

  • getStates(i: number, states: number[]): void
  • Gets the states at the given position [i]. The position is relative to specified variable ordering in the {@link com.bayesserver.TableAccessor}.

    exception

    ReferenceError Raised if [states] is null.

    exception

    Error Raised if [states] is too short.

    Parameters

    • i: number

      The position at which to retrieve the states.

    • states: number[]

      A buffer for the states, which is overwritten by the method.

    Returns void

getTableIndex

  • getTableIndex(i: number): number
  • Gets the equivalent index in the underlying table that corresponds to the index in the accessor.

    Parameters

    • i: number

      The accessor index.

    Returns number

    The equivalent underlying table index.

set

  • set(states: number[], value: number): void
  • set(i: number, value: number): void
  • Sets the underlying {@link com.bayesserver.Table} value, using states corresponding to the order of variables in the {@link com.bayesserver.TableAccessor}.

    Parameters

    • states: number[]
    • value: number

      The underlying {@link com.bayesserver.Table} value.

    Returns void

  • Sets the underlying {@link com.bayesserver.Table} value, specified i.

    Parameters

    • i: number
    • value: number

      The table value.

    Returns void