AddColumn(string) - Appends a new column of data, sets the name, and returns the new column's index. Initilizes with null values.
RemoveColumn(int) - Removes a column of data.
RemoveColumns(string, ...) - Removes multiple columns of data by name.
GetColumnName(int) - Gets the column name.
SetColumnName(int, string) - Sets the column name.
GetColIndexFromName(string) - Returns the index for a given column name.
AddRow(int) - Appends a new row of data, sets the id, and returns the new row's index. Initilize with null values.
RemoveRow(int) - Removes a row of data by index.
RemoveRows(int, ...) - Removes multiple rows of data by id.
RemoveRows(ArrayList) - Removes multiple rows of data by id.
Filter(int, ...) - Removes all rows except the ones specified.
Filter(ArrayList) - Removes all rows except the ones specified.
GetRowId(int) - Gets a row id.
GetRowIndexFromId(int) - Returns the index for a given row id.
Copy() - Returns a new DataContainer that is a deep copy of this object.
Clear() - Removes all the data, row ids, and col names.
Trim() - Trims the data to the minimum size and runs the garbage collector.
Append(DataContainer) - Takes another DataContainer and adds the rows to this object. There must be the same number of columns and the column names must be identical. The row ids must be exclusive to each data set, e.g. there can't be the same row id in both data sets. If there is a row id conflict, an error will be thrown and no changes are made to the data.
Merge(DataContainer) - Takes another DataContainer and adds the columns to this object. Rows that are in one data set and not the other will be added and null values inserted for the rest of the other data set. Column names must be unique to each data set, e.g. there can't be the same column name in both data sets. When there is a column name conflict, an error will be thrown and no changes are made to the data.
Save(string) - Gets the default delimiter and calls the appropriate Save(string, string).
GetDataHeader(string) - Returns an arraylist that contains the header (the column info) for the data set.
Properties
Name - Gets/sets the name.
NumRows - Gets the number of rows.
NumCols - Gets the number of columns.
Protected Methods
Copy(DataContainer) - Copies a DataContainer over the current object.
GetDataObject(int, int) - Accesses a data item.
SetDataObject(int, int, object) - Sets a data item.
Delimiter(string) - Determines the default delimiter based on filename.
RebuildColIndices() - Rebuilds the column name to index map.
RebuildRowIndices() - Rebuilds to row id to index map.
Virtual Methods
Load(string) - Place holder for child class implementations.
Save(string, string) - Place holder for child class implementations.
Protected Members
ArrayList rowIds - Row index to row id mapping.
SortedList rowIndices - Row id to row index mapping.
ArrayList colNames - Column index to column name mapping.
SortedList colIndices - Column name to column index mapping.
ArrayList data - Set of data columns.
string name - The name of the data set.
Exceptions
Merging data with different number of rows.
Merging data with different row ids.
Merging data with duplicate column names.
Appending data with different number of columns.
Appending data with different column names.
Appending data with duplicate row ids.
Adding a column with a duplicate name.
Adding a row with a duplicate id.
Setting a column with a duplicate name.
Setting a row with a duplicate id.
Invalid indices.
Rationale
Using columns of data: Columns of data are used due to the fact that there are more rows then columns. This should save some on memory.
Whenever a row or column is added, the values are initilised to null values. This takes care of the need for the integrity check.
Whenever a row or column is added, the id or name used cannot interfere with another id/name already in use.