Class VelocityDataRow
- Namespace
- Datafication.Storage.Velocity
- Assembly
- Datafication.Storage.Velocity.dll
Lightweight row wrapper for streaming enumeration without full materialization. Provides on-demand value access with minimal memory overhead.
public sealed class VelocityDataRow
- Inheritance
-
objectVelocityDataRow
Remarks
VelocityDataRow is designed for efficient streaming enumeration of VelocityResult rows. It does not copy any data until values are actually accessed, providing O(1) memory overhead per row during enumeration.
Values are read directly from the source VelocityDataBlock on demand. For repeated access to the same row's values, consider using ToArray() or ToDictionary() to cache the values locally.
Properties
ColumnCount
Gets the number of columns in this row, including computed columns.
public int ColumnCount { get; }
Property Value
- int
ColumnNames
Gets the column names available in this row, including computed columns.
public IReadOnlyList<string> ColumnNames { get; }
Property Value
- IReadOnlyList<string>
this[int]
Gets a value by column index.
public object? this[int columnIndex] { get; }
Parameters
columnIndexintThe index of the column (0-based).
Property Value
- object
The value at the specified column.
Exceptions
- ArgumentOutOfRangeException
If the column index is out of range.
this[string]
Gets a value by column name.
public object? this[string columnName] { get; }
Parameters
columnNamestringThe name of the column.
Property Value
- object
The value at the specified column.
Exceptions
- ArgumentException
If the column does not exist.
RowIndex
Gets the row index in the source VelocityDataBlock.
public uint RowIndex { get; }
Property Value
- uint
Methods
GetValue<T>(int)
Gets a value by column index with type conversion.
public T? GetValue<T>(int columnIndex)
Parameters
columnIndexintThe index of the column.
Returns
- T
The value converted to the specified type.
Type Parameters
TThe expected type of the value.
GetValue<T>(string)
Gets a value by column name with type conversion.
public T? GetValue<T>(string columnName)
Parameters
columnNamestringThe name of the column.
Returns
- T
The value converted to the specified type.
Type Parameters
TThe expected type of the value.
HasColumn(string)
Checks if a column exists in this row, including computed columns.
public bool HasColumn(string columnName)
Parameters
columnNamestringThe name of the column.
Returns
- bool
True if the column exists, false otherwise.
ToArray()
Gets all values as an array, including computed columns.
public object?[] ToArray()
Returns
- object[]
An array of all column values.
ToDictionary()
Gets all values as a dictionary, including computed columns.
public Dictionary<string, object?> ToDictionary()
Returns
- Dictionary<string, object>
A dictionary mapping column names to values.
TryGetValue(string, out object?)
Tries to get a value by column name.
public bool TryGetValue(string columnName, out object? value)
Parameters
columnNamestringThe name of the column.
valueobjectThe value if found, or null.
Returns
- bool
True if the column exists, false otherwise.