Each cell directly contains information about its coordinates in the CSV data.
Each cell directly contains information about its coordinates in the CSV data.
The rationale is that this makes processing streams of cells simpler and allows for detecting many types of errors. Also when problems are detected the coordinates of the problematic cell can easily be included in the error messages.
It is true that in most cases the coordinates of the cell would be known from surrounding data structures. However if we relied solely on that, there would not be an easy uniform way for code operating on cells to know coordinates of each cell.
Another downside is that cell instances can't be reused in different places in data in style of the flyweight pattern.
The data as it would be represented in CSV file on disk sans quoting.
The data as it would be represented in CSV file on disk sans quoting.
Subclasses of this Cell type should provide more meaningful ways of accessing data.
Shorter version of toString
to be used in debug table outputs.
Shorter version of toString
to be used in debug table outputs.
Should identify cell type and value in small amount of text.
The cellKey
should not be in the return value.
Make a copy of this cell, but with different cell key.
The data in possibly more refined form than serializedString depending on the subclass of Cell in question.
The data in possibly more refined form than serializedString depending on the subclass of Cell in question.
For example IntegerCell returns Int.
Shortcut to index in CellKey.colKey
Shortcut to CellKey.colKey
Shortcut to index in CellKey.rowKey
Shortcut to CellKey.rowKey
Base class for cells used in this CSV library.
The two main APIs of this library the table oriented and the stream oriented use subclasses of this class to represent the data.
One important use for this class is in CsvReader. CsvReader outputs instances of StringCell which is a subclass of this class.
See the documentation of cellKey member below for design rationale on having coordinates in each cell.