Table of Contents

Class DataModelTable

Namespace
LlamaLogic.Packages.Models.Data
Assembly
LlamaLogic.Packages.dll

Represents a table in a SimData or CombinedTuning resource (🔓)

public sealed class DataModelTable
Inheritance
DataModelTable
Inherited Members

Constructors

DataModelTable(string?, string?, uint?)

Represents a table in a SimData or CombinedTuning resource (🔓)

public DataModelTable(string? name, string? schemaName, uint? schemaHash)

Parameters

name string
schemaName string
schemaHash uint?

Properties

ColumnCount

Gets the number of columns

public int ColumnCount { get; }

Property Value

int

this[Index]

Gets/sets the values of the specified rowIndex

public object? this[Index rowIndex] { get; set; }

Parameters

rowIndex Index

Property Value

object

this[Index, Index]

Gets/sets the value at the specified rowIndex and columnIndex

public object? this[Index rowIndex, Index columnIndex] { get; set; }

Parameters

rowIndex Index
columnIndex Index

Property Value

object

this[Index, string]

Gets/sets the value of the specified rowIndex for column with the specified columnName

public object? this[Index rowIndex, string columnName] { get; set; }

Parameters

rowIndex Index
columnName string

Property Value

object

Name

Gets/sets the name of the table

public string? Name { get; set; }

Property Value

string

RawValues

Gets the raw values of the table

public IEnumerable<object?> RawValues { get; }

Property Value

IEnumerable<object>

RowCount

Gets the number of rows

public int RowCount { get; }

Property Value

int

SchemaHash

Gets/sets the unique identifier for the schema of the table

public uint? SchemaHash { get; set; }

Property Value

uint?

SchemaName

Gets/sets the name of the schema of the table

public string? SchemaName { get; set; }

Property Value

string

Methods

AddColumn(string?, DataModelType, ushort, IEnumerable<object?>?)

Adds a column with the specified name, type, flags, and values, and returns the index of the column

public int AddColumn(string? name, DataModelType type, ushort flags = 0, IEnumerable<object?>? values = null)

Parameters

name string
type DataModelType
flags ushort
values IEnumerable<object>

Returns

int

AddRow(object?)

Adds the specified row and returns the index of the row

public int AddRow(object? row)

Parameters

row object

Returns

int

Get(Index)

Gets the values of the row at the specified rowIndex

public object? Get(Index rowIndex)

Parameters

rowIndex Index

Returns

object

Get(Index, Index)

Gets the value at the specified rowIndex and columnIndex

public object? Get(Index rowIndex, Index columnIndex)

Parameters

rowIndex Index
columnIndex Index

Returns

object

Get(Index, string)

Gets the value at the specified rowIndex for the column with the specified columnName

public object? Get(Index rowIndex, string columnName)

Parameters

rowIndex Index
columnName string

Returns

object

GetColumnFlags(Index)

Gets the flags of the column at the specified index

public ushort GetColumnFlags(Index index)

Parameters

index Index

Returns

ushort

GetColumnFlags(string)

Gets the flags of the column with the specified columnName

public ushort GetColumnFlags(string columnName)

Parameters

columnName string

Returns

ushort

GetColumnIndex(string)

Gets the index of the column with the specified columnName, or null if the column does not exist

public int? GetColumnIndex(string columnName)

Parameters

columnName string

Returns

int?

GetColumnName(Index)

Gets the name of the column at the specified index

public string? GetColumnName(Index index)

Parameters

index Index

Returns

string

GetColumnType(Index)

Gets the DataModelType of the column at the specified index

public DataModelType GetColumnType(Index index)

Parameters

index Index

Returns

DataModelType

GetColumnType(string)

Gets the DataModelType of the column with the specified columnName

public DataModelType GetColumnType(string columnName)

Parameters

columnName string

Returns

DataModelType

GetColumnValues(Index)

Gets all the values for the column at the specified index

public IReadOnlyList<object?> GetColumnValues(Index index)

Parameters

index Index

Returns

IReadOnlyList<object>

GetColumnValues(Index, Index, Predicate<object?>)

Gets the values for the specified columnIndex starting at the specified startingRowIndex for as long as the takeWhile predicate returns true

public IReadOnlyList<object?> GetColumnValues(Index columnIndex, Index startingRowIndex, Predicate<object?> takeWhile)

Parameters

columnIndex Index
startingRowIndex Index
takeWhile Predicate<object>

Returns

IReadOnlyList<object>

GetColumnValues(Index, Range)

Gets the values for the column at the specified columnIndex for the specified rows

public IReadOnlyList<object?> GetColumnValues(Index columnIndex, Range rows)

Parameters

columnIndex Index
rows Range

Returns

IReadOnlyList<object>

GetColumnValues(string)

Gets all the values for the column with the specified columnName

public IReadOnlyList<object?> GetColumnValues(string columnName)

Parameters

columnName string

Returns

IReadOnlyList<object>

GetColumnValues(string, Index, Predicate<object?>)

Gets the values for the column with the specified columnName starting at the specified startingRowIndex for as long as the takeWhile predicate returns true

public IReadOnlyList<object?> GetColumnValues(string columnName, Index startingRowIndex, Predicate<object?> takeWhile)

Parameters

columnName string
startingRowIndex Index
takeWhile Predicate<object>

Returns

IReadOnlyList<object>

GetColumnValues(string, Range)

Gets the values for the column with the specified columnName for the specified rows

public IReadOnlyList<object?> GetColumnValues(string columnName, Range rows)

Parameters

columnName string
rows Range

Returns

IReadOnlyList<object>

GetRawValue(Index)

Gets the value of a raw table for the specified row

public object? GetRawValue(Index row)

Parameters

row Index

Returns

object

GetRawValues(int, int)

Gets the values of a raw table for the specified number of rows beginning at the specified rowIndex

public IReadOnlyList<object?> GetRawValues(int rowIndex, int rows)

Parameters

rowIndex int
rows int

Returns

IReadOnlyList<object>

GetRawValues(Range)

Gets the values of a raw table for the specified rows

public IReadOnlyList<object?> GetRawValues(Range rows)

Parameters

rows Range

Returns

IReadOnlyList<object>

InsertColumn(Index, string?, DataModelType, ushort, IEnumerable<object?>?)

Inserts a column with the specified name, type, and flags at the specified index

public void InsertColumn(Index index, string? name, DataModelType type, ushort flags = 0, IEnumerable<object?>? values = null)

Parameters

index Index
name string
type DataModelType
flags ushort
values IEnumerable<object>

InsertRow(Index, object?)

Inserts the specified row at the specified index

public void InsertRow(Index index, object? row)

Parameters

index Index
row object

RemoveColumn(Index)

Removes the column at the specified index

public void RemoveColumn(Index index)

Parameters

index Index

RemoveColumn(string)

Removes the column with the specified columnName and returns the index at which the column was removed

public int RemoveColumn(string columnName)

Parameters

columnName string

Returns

int

RemoveRow(Index)

Removes the row at the specified index

public void RemoveRow(Index index)

Parameters

index Index

Set(Index, Index, object?)

Sets the value at the specified rowIndex and columnIndex

public void Set(Index rowIndex, Index columnIndex, object? value)

Parameters

rowIndex Index
columnIndex Index
value object

Set(Index, object?)

Sets the row at the specified index

public void Set(Index index, object? row)

Parameters

index Index
row object

Set(Index, string, object?)

Sets the value of the specified rowIndex for column with the specified columnName

public void Set(Index rowIndex, string columnName, object? value)

Parameters

rowIndex Index
columnName string
value object

SetColumnFlags(Index, ushort)

Sets the flags of the column at the specified index

public void SetColumnFlags(Index index, ushort flags)

Parameters

index Index
flags ushort

SetColumnFlags(string, ushort)

Sets the flags of the column with the specified columnName

public void SetColumnFlags(string columnName, ushort flags)

Parameters

columnName string
flags ushort

SetColumnName(Index, string?)

Sets the name of the column at the specified index

public void SetColumnName(Index index, string? name)

Parameters

index Index
name string

SetRawValue(Index, object?)

Sets the value of a raw table for the specified row

public void SetRawValue(Index row, object? value)

Parameters

row Index
value object

SetRawValues(Range, IEnumerable<object?>)

Replaces the specified rows in a raw table with the specified values, returning the length of values

public int SetRawValues(Range rows, IEnumerable<object?> values)

Parameters

rows Range
values IEnumerable<object>

Returns

int