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
Properties
ColumnCount
Gets the number of columns
public int ColumnCount { get; }
Property Value
this[Index]
Gets/sets the values of the specified rowIndex
public object? this[Index rowIndex] { get; set; }
Parameters
rowIndexIndex
Property Value
this[Index, Index]
Gets/sets the value at the specified rowIndex and columnIndex
public object? this[Index rowIndex, Index columnIndex] { get; set; }
Parameters
Property Value
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
Property Value
Name
Gets/sets the name of the table
public string? Name { get; set; }
Property Value
RawValues
Gets the raw values of the table
public IEnumerable<object?> RawValues { get; }
Property Value
RowCount
Gets the number of rows
public int RowCount { get; }
Property Value
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
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
namestringtypeDataModelTypeflagsushortvaluesIEnumerable<object>
Returns
AddRow(object?)
Adds the specified row and returns the index of the row
public int AddRow(object? row)
Parameters
rowobject
Returns
Get(Index)
Gets the values of the row at the specified rowIndex
public object? Get(Index rowIndex)
Parameters
rowIndexIndex
Returns
Get(Index, Index)
Gets the value at the specified rowIndex and columnIndex
public object? Get(Index rowIndex, Index columnIndex)
Parameters
Returns
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
Returns
GetColumnFlags(Index)
Gets the flags of the column at the specified index
public ushort GetColumnFlags(Index index)
Parameters
indexIndex
Returns
GetColumnFlags(string)
Gets the flags of the column with the specified columnName
public ushort GetColumnFlags(string columnName)
Parameters
columnNamestring
Returns
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
columnNamestring
Returns
- int?
GetColumnName(Index)
Gets the name of the column at the specified index
public string? GetColumnName(Index index)
Parameters
indexIndex
Returns
GetColumnType(Index)
Gets the DataModelType of the column at the specified index
public DataModelType GetColumnType(Index index)
Parameters
indexIndex
Returns
GetColumnType(string)
Gets the DataModelType of the column with the specified columnName
public DataModelType GetColumnType(string columnName)
Parameters
columnNamestring
Returns
GetColumnValues(Index)
Gets all the values for the column at the specified index
public IReadOnlyList<object?> GetColumnValues(Index index)
Parameters
indexIndex
Returns
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
Returns
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
Returns
GetColumnValues(string)
Gets all the values for the column with the specified columnName
public IReadOnlyList<object?> GetColumnValues(string columnName)
Parameters
columnNamestring
Returns
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
Returns
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
Returns
GetRawValue(Index)
Gets the value of a raw table for the specified row
public object? GetRawValue(Index row)
Parameters
rowIndex
Returns
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
Returns
GetRawValues(Range)
Gets the values of a raw table for the specified rows
public IReadOnlyList<object?> GetRawValues(Range rows)
Parameters
rowsRange
Returns
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
indexIndexnamestringtypeDataModelTypeflagsushortvaluesIEnumerable<object>
InsertRow(Index, object?)
Inserts the specified row at the specified index
public void InsertRow(Index index, object? row)
Parameters
RemoveColumn(Index)
Removes the column at the specified index
public void RemoveColumn(Index index)
Parameters
indexIndex
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
columnNamestring
Returns
RemoveRow(Index)
Removes the row at the specified index
public void RemoveRow(Index index)
Parameters
indexIndex
Set(Index, Index, object?)
Sets the value at the specified rowIndex and columnIndex
public void Set(Index rowIndex, Index columnIndex, object? value)
Parameters
Set(Index, object?)
Sets the row at the specified index
public void Set(Index index, object? row)
Parameters
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
SetColumnFlags(Index, ushort)
Sets the flags of the column at the specified index
public void SetColumnFlags(Index index, ushort flags)
Parameters
SetColumnFlags(string, ushort)
Sets the flags of the column with the specified columnName
public void SetColumnFlags(string columnName, ushort flags)
Parameters
SetColumnName(Index, string?)
Sets the name of the column at the specified index
public void SetColumnName(Index index, string? name)
Parameters
SetRawValue(Index, object?)
Sets the value of a raw table for the specified row
public void SetRawValue(Index row, object? value)
Parameters
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
rowsRangevaluesIEnumerable<object>