Class DataRowCursor
- Namespace
- Datafication.Core.Data
- Assembly
- Datafication.Core.dll
Represents a cursor for iterating over rows in a DataBlock. Optimized for performance with pre-cached column references.
public class DataRowCursor : IDataRowCursor
- Inheritance
-
objectDataRowCursor
- Implements
Constructors
DataRowCursor(DataColumnCollection, List<string>)
Initializes a new instance of the DataRowCursor class.
public DataRowCursor(DataColumnCollection dataColumns, List<string> columnNames = null)
Parameters
dataColumnsDataColumnCollectionThe data column collection to iterate over.
columnNamesList<string>The names of the columns to include, or null for all columns.
Properties
this[string]
Gets the value for the specified column at the current row position using indexer syntax.
public object this[string columnName] { get; }
Parameters
columnNamestringThe name of the column.
Property Value
- object
The value for the specified column.
Position
Gets the current position of the cursor.
public int Position { get; }
Property Value
- int
Schema
Gets the schema of the data block.
public DataSchema Schema { get; }
Property Value
Methods
Dispose()
Disposes the cursor and releases resources.
public void Dispose()
ExtractCurrentRow()
Extracts all values for the current row as an array. Useful for batch operations.
public object[] ExtractCurrentRow()
Returns
- object[]
Array of values for the current row.
GetValue(string)
Gets the value for the specified column at the current row position using fast cached access.
public object GetValue(string columnName)
Parameters
columnNamestringThe name of the column.
Returns
- object
The value for the specified column.
GetValueByIndex(int)
Gets the value for the specified column index at the current row position. This is the fastest access method.
public object GetValueByIndex(int columnIndex)
Parameters
columnIndexintThe zero-based column index.
Returns
- object
The value for the specified column.
IsEnd()
Determines whether the cursor has reached the end of the data column collection.
public bool IsEnd()
Returns
- bool
trueif the cursor is at the end; otherwise,false.
MoveBy(int)
Moves the cursor by the specified offset.
public void MoveBy(int offset)
Parameters
offsetintThe number of rows to move by.
MoveNext()
Advances the cursor to the next row in the DataBlock.
public bool MoveNext()
Returns
- bool
True if the cursor successfully moved to the next row; otherwise, false if the cursor has passed the end of the collection.
MoveTo(int)
Moves the cursor to the specified index.
public void MoveTo(int index)
Parameters
indexintThe row index to move to.
Reset()
Resets the cursor to the initial position.
public void Reset()