Interface WritableTabularDataSource
- All Known Implementing Classes:
CSVTabularDataSetCollectionConnector,CSVTabularDataSetConnector,DB2LUWTabularDataSetCollectionConnector,DB2LUWTabularDataSetConnector,MSSQLTabularDataSetCollectionConnector,MSSQLTabularDataSetConnector,OracleTabularDataSetCollectionConnector,OracleTabularDataSetConnector,PostgresTabularDataSetCollectionConnector,PostgresTabularDataSetConnector
public interface WritableTabularDataSource
WritableTabularDataSource defines the specific connector api for working with
simple tabular data. Each row represents a record
that is divided into columns. Each row has the same list of columns and so the data source is
effectively a table of data.
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendRecord(List<String> dataValues) Write the requested data record to the end of the data source.default voidappendRecords(List<List<String>> dataRecords) Write several data records to the end of the data source, in the order supplied.voiddeleteRecord(long rowNumber) Remove the requested data record.default voiddeleteRecords(List<Long> rowNumbers) Remove several data records.longReturn the record count in the data source.voidsetColumnDescriptions(List<TabularColumnDescription> columnDescriptions) Set up the columns associated with this tabular data source.voidwriteRecord(long rowNumber, List<String> dataValues) Write the requested data record.default voidwriteRecords(Map<Long, List<String>> dataRecords) Write several data records, each at its row number.
-
Method Details
-
getRecordCount
Return the record count in the data source.- Returns:
- count
- Throws:
ConnectorCheckedException- data access problem
-
setColumnDescriptions
void setColumnDescriptions(List<TabularColumnDescription> columnDescriptions) throws ConnectorCheckedException Set up the columns associated with this tabular data source. These may be stored in the data set or kept in memory for this instance. The names of the columns will be in a canonical format where each word in the name is capitalized with a space between each word. This allows simple translation between the naming conventions supported by different technologies.- Parameters:
columnDescriptions- a list of column descriptions- Throws:
ConnectorCheckedException- data access problem
-
writeRecord
Write the requested data record. The first data record is record 0.- Parameters:
rowNumber- longdataValues- Map of column descriptions to strings, each string is the value for the column.- Throws:
ConnectorCheckedException- a problem occurred accessing the data.
-
appendRecord
Write the requested data record to the end of the data source.- Parameters:
dataValues- Map of column descriptions to strings, each string is the value for the column.- Throws:
ConnectorCheckedException- a problem occurred accessing the data.
-
deleteRecord
Remove the requested data record. The first data record is record 0.- Parameters:
rowNumber- long- Throws:
ConnectorCheckedException- a problem occurred accessing the data.
-
writeRecords
Write several data records, each at its row number. A data source that can write many records more cheaply together than one at a time - in one transaction, say - overrides this; by default each record is written withwriteRecord(long, java.util.List<java.lang.String>), in the map's order.- Parameters:
dataRecords- map of row number to the values of the record to write there- Throws:
ConnectorCheckedException- a problem occurred accessing the data.
-
appendRecords
Write several data records to the end of the data source, in the order supplied. By default each record is written withappendRecord(java.util.List<java.lang.String>).- Parameters:
dataRecords- values of each record to append- Throws:
ConnectorCheckedException- a problem occurred accessing the data.
-
deleteRecords
Remove several data records. Each row number is the record's position before any of them is removed. By default they are removed withdeleteRecord(long)from the highest row number down, so that each removal leaves the positions of those still to go unchanged.- Parameters:
rowNumbers- positions of the records to remove; the same position listed twice is removed once- Throws:
ConnectorCheckedException- a problem occurred accessing the data.
-