@@ -12,6 +12,11 @@ public class UXFDataTable
1212 public string [ ] Headers { get { return dict . Keys . ToArray ( ) ; } }
1313 private Dictionary < string , List < object > > dict ;
1414
15+ /// <summary>
16+ /// Construct a table with given estimated row capacity and column names.
17+ /// </summary>
18+ /// <param name="capacity"></param>
19+ /// <param name="columnNames"></param>
1520 public UXFDataTable ( int capacity , params string [ ] columnNames )
1621 {
1722 dict = new Dictionary < string , List < object > > ( ) ;
@@ -21,6 +26,10 @@ public UXFDataTable(int capacity, params string[] columnNames)
2126 }
2227 }
2328
29+ /// <summary>
30+ /// Construct a table with given column names.
31+ /// </summary>
32+ /// <param name="columnNames"></param>
2433 public UXFDataTable ( params string [ ] columnNames )
2534 {
2635 dict = new Dictionary < string , List < object > > ( ) ;
@@ -30,6 +39,10 @@ public UXFDataTable(params string[] columnNames)
3039 }
3140 }
3241
42+ /// <summary>
43+ /// Add a complete row to the table
44+ /// </summary>
45+ /// <param name="newRow"></param>
3346 public void AddCompleteRow ( UXFDataRow newRow )
3447 {
3548 bool sameKeys = ( dict
@@ -59,6 +72,10 @@ public void AddCompleteRow(UXFDataRow newRow)
5972 }
6073 }
6174
75+ /// <summary>
76+ /// Count and return the number of rows.
77+ /// </summary>
78+ /// <returns></returns>
6279 public int CountRows ( )
6380 {
6481 string [ ] keyArray = dict . Keys . ToArray ( ) ;
@@ -67,6 +84,10 @@ public int CountRows()
6784 return dict [ keyArray [ 0 ] ] . Count ( ) ;
6885 }
6986
87+ /// <summary>
88+ /// Return the table as a set of strings, each string a line a row with comma-seperated values.
89+ /// </summary>
90+ /// <returns></returns>
7091 public string [ ] GetCSVLines ( )
7192 {
7293 string [ ] headers = Headers ;
@@ -83,6 +104,10 @@ public string[] GetCSVLines()
83104 return lines ;
84105 }
85106
107+ /// <summary>
108+ /// Return the table as a dictionary of lists.
109+ /// </summary>
110+ /// <returns></returns>
86111 public Dictionary < string , List < object > > GetAsDictOfList ( )
87112 {
88113 Dictionary < string , List < object > > dictCopy = new Dictionary < string , List < object > > ( ) ;
@@ -93,6 +118,10 @@ public Dictionary<string, List<object>> GetAsDictOfList()
93118 return dictCopy ;
94119 }
95120
121+ /// <summary>
122+ /// Return the table as a list of dictionaries.
123+ /// </summary>
124+ /// <returns></returns>
96125 public List < Dictionary < string , object > > GetAsListOfDict ( )
97126 {
98127 int numRows = CountRows ( ) ;
0 commit comments