Class DefaultDataTable

  • All Implemented Interfaces:
    RootTable, TableDataSource
    Direct Known Subclasses:
    DataTable, FunctionTable, TemporaryTable

    public abstract class DefaultDataTable
    extends AbstractDataTable
    This represents a default implementation of a DataTable. It encapsulates information that is core to all DataTable objects. That is,

    The table name, The description of the table fields, A set of SelectableScheme objects to describe row relations, A counter for the number of rows in the table.

    There are two classes that extend this object. DataTable which is a DataTable that is a direct mapping to an internal table stored in the Database files. And TemporaryTable that contains information generated on the fly by the DBMS.

    Author:
    Tobias Downer
    • Field Detail

      • row_count

        protected int row_count
        The number of rows in the table.
    • Method Detail

      • getDatabase

        public Database getDatabase()
        Returns the Database object this table is part of.
        Specified by:
        getDatabase in class Table
      • getRootColumnScheme

        protected SelectableScheme getRootColumnScheme​(int column)
        Returns the SelectableScheme for the given column. This is different from 'getColumnScheme(int column)' because this is designed to be overridden so derived classes can manage their own SelectableScheme sources.
      • clearColumnScheme

        protected void clearColumnScheme​(int column)
        Clears the SelectableScheme information for the given column.
      • blankSelectableSchemes

        protected void blankSelectableSchemes()
        Blanks all the column schemes in the table to an initial state. This will make all schemes of type InsertSearch.

        NOTE: The current default SelectableScheme type is InsertSearch. We may want to make this variable.

      • blankSelectableSchemes

        protected void blankSelectableSchemes​(int type)
        Blanks all the column schemes in this table to a specific type of scheme. If Type = 0 then InsertSearch (fast but takes up memory - requires each insert and delete from the table to be logged). If type = 1 then BlindSearch (slower but uses no memory and doesn't require insert and delete to be logged).
      • getColumnCount

        public int getColumnCount()
        Returns the number of columns in the table.
        Specified by:
        getColumnCount in class Table
      • getResolvedVariable

        public Variable getResolvedVariable​(int column)
        Returns a fully qualified Variable object that represents the name of the column at the given index. For example, new Variable(new TableName("APP", "CUSTOMER"), "ID")
        Specified by:
        getResolvedVariable in class Table
      • findFieldName

        public int findFieldName​(Variable v)
        Given a fully qualified variable field name, ie. 'APP.CUSTOMER.CUSTOMERID' this will return the column number the field is at. Returns -1 if the field does not exist in the table.
        Specified by:
        findFieldName in class Table