refactor: Add default impl for columnInfo indexers in IBlueTableSchema

This commit is contained in:
John Colvin committed 2025-11-15 12:46:25 -05:00
1 parent 197a81443c
commit 0ff372a63e
1 file changed
+13 -4
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace BCG
{
@@ -12,11 +11,21 @@ namespace BCG
/// <summary>
/// index w.r.t. the ordinal
/// </summary>
ColumnInfo this[int index]{get;}
ColumnInfo this[int index] => columnInfo[index];
/// <summary>
/// index w.r.t. column name
/// </summary>
ColumnInfo this[string colName]{get;}
ColumnInfo this[string colName] {
get {
var colInfos = columnInfo;
for (int i = 0; i < colInfos.Length; i++) {
if (colInfos[i].colName == colName) {
return colInfos[i];
}
}
throw new KeyNotFoundException();
}
}
/// <summary>
/// Utility method to get all the column names
/// </summary>