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 Details

    • getRecordCount

      long getRecordCount() throws ConnectorCheckedException
      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

      void writeRecord(long rowNumber, List<String> dataValues) throws ConnectorCheckedException
      Write the requested data record. The first data record is record 0.
      Parameters:
      rowNumber - long
      dataValues - Map of column descriptions to strings, each string is the value for the column.
      Throws:
      ConnectorCheckedException - a problem occurred accessing the data.
    • appendRecord

      void appendRecord(List<String> dataValues) throws ConnectorCheckedException
      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

      void deleteRecord(long rowNumber) throws ConnectorCheckedException
      Remove the requested data record. The first data record is record 0.
      Parameters:
      rowNumber - long
      Throws:
      ConnectorCheckedException - a problem occurred accessing the data.
    • writeRecords

      default void writeRecords(Map<Long,List<String>> dataRecords) throws ConnectorCheckedException
      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 with writeRecord(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

      default void appendRecords(List<List<String>> dataRecords) throws ConnectorCheckedException
      Write several data records to the end of the data source, in the order supplied. By default each record is written with appendRecord(java.util.List<java.lang.String>).
      Parameters:
      dataRecords - values of each record to append
      Throws:
      ConnectorCheckedException - a problem occurred accessing the data.
    • deleteRecords

      default void deleteRecords(List<Long> rowNumbers) throws ConnectorCheckedException
      Remove several data records. Each row number is the record's position before any of them is removed. By default they are removed with deleteRecord(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.