| java.lang.Object com.mckoi.database.Table com.mckoi.database.AbstractDataTable com.mckoi.database.DefaultDataTable
All known Subclasses: com.mckoi.database.FunctionTable, com.mckoi.database.TemporaryTable, com.mckoi.database.DataTable,
DefaultDataTable | abstract public class DefaultDataTable extends AbstractDataTable (Code) | | 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 Summary | |
protected int | row_count The number of rows in the table. |
row_count | protected int row_count(Code) | | The number of rows in the table.
|
DefaultDataTable | DefaultDataTable(Database database)(Code) | | The Constructor.
|
addCellToColumnSchemes | void addCellToColumnSchemes(int row_number, int column_number)(Code) | | Adds a single column of a row to the selectable scheme indexing.
|
addRowToColumnSchemes | void addRowToColumnSchemes(int row_number)(Code) | | This is called when a row is in the table, and the SelectableScheme
objects for each column need to be notified of the rows existance,
therefore build up the relational model for the columns.
|
blankSelectableSchemes | protected void blankSelectableSchemes()(Code) | | 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)(Code) | | 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).
|
clearColumnScheme | protected void clearColumnScheme(int column)(Code) | | Clears the SelectableScheme information for the given column.
|
findFieldName | public int findFieldName(Variable v)(Code) | | 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.
|
getColumnCount | public int getColumnCount()(Code) | | Returns the number of columns in the table.
|
getDatabase | public Database getDatabase()(Code) | | Returns the Database object this table is part of.
|
getResolvedVariable | public Variable getResolvedVariable(int column)(Code) | | 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")
|
getRootColumnScheme | protected SelectableScheme getRootColumnScheme(int column)(Code) | | 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.
|
getRowCount | public int getRowCount()(Code) | | Returns the number of rows stored in the table.
|
getSelectableSchemeFor | SelectableScheme getSelectableSchemeFor(int column, int original_column, Table table)(Code) | | Returns a SelectableScheme object for the given column of the
VirtualTable. The Table parameter specifies the domain in which the
scheme should be given. If table != this, we can safely assume it is a
VirtualTable.
|
removeRowToColumnSchemes | void removeRowToColumnSchemes(int row_number)(Code) | | This is called when an index to a row needs to be removed from the
SelectableScheme objects. This occurs when we have a modification log
of row removals that haven't actually happened to old backed up scheme.
|
resolveToRawTable | RawTableInformation resolveToRawTable(RawTableInformation info)(Code) | | Return the list of DataTable and row sets that make up the raw information
in this table. For a DataTable itselt, this is trivial.
NOTE: Using this method is extremely inefficient, and should never be
used. It is included only to complete feature set.
IDEA: Put a warning to check if this method is ever used.
|
setToRowTableDomain | void setToRowTableDomain(int column, IntegerVector row_set, TableDataSource ancestor)(Code) | | Given a set, this trickles down through the Table hierarchy resolving
the given row_set to a form that the given ancestor understands.
Say you give the set { 0, 1, 2, 3, 4, 5, 6 }, this function may check
down three levels and return a new 7 element set with the rows fully
resolved to the given ancestors domain.
|
Fields inherited from com.mckoi.database.Table | protected static boolean DEBUG_QUERY(Code)(Java Doc)
|
Methods inherited from com.mckoi.database.Table | public DebugLogger Debug()(Code)(Java Doc) abstract void addDataTableListener(DataTableListener listener)(Code)(Java Doc) public Table all(QueryContext context, Expression lhs, Operator op, Table table)(Code)(Java Doc) final public boolean allColumnMatchesValue(int column, Operator op, TObject ob)(Code)(Java Doc) final IntegerVector allRowsIn(int column, Table table)(Code)(Java Doc) final IntegerVector allRowsNotIn(int column, Table table)(Code)(Java Doc) public Table any(QueryContext context, Expression lhs, Operator op, Table right_table)(Code)(Java Doc) final public boolean columnContainsCell(int column, TObject cell)(Code)(Java Doc) final public boolean columnContainsValue(int column, TObject ob)(Code)(Java Doc) final public boolean columnMatchesValue(int column, Operator op, TObject ob)(Code)(Java Doc) final public Table columnMerge(Table table)(Code)(Java Doc) public static boolean compareCells(TObject ob1, TObject ob2, Operator op)(Code)(Java Doc) final public VirtualTable distinct()(Code)(Java Doc) final public Table distinct(int[] col_map)(Code)(Java Doc) final public void dumpTo(PrintStream out) throws IOException(Code)(Java Doc) final public Table emptySelect()(Code)(Java Doc) final public Table exhaustiveSelect(QueryContext context, Expression exp)(Code)(Java Doc) final public int fastFindFieldName(Variable col)(Code)(Java Doc) abstract public int findFieldName(Variable v)(Code)(Java Doc) abstract public TObject getCellContents(int column, int row)(Code)(Java Doc) abstract public int getColumnCount()(Code)(Java Doc) public DataTableColumnDef getColumnDefAt(int col_index)(Code)(Java Doc) public SelectableScheme getColumnScheme(int column)(Code)(Java Doc) abstract public DataTableDef getDataTableDef()(Code)(Java Doc) abstract public Database getDatabase()(Code)(Java Doc) final public TObject getFirstCellContent(int column)(Code)(Java Doc) final public TObject[] getFirstCellContent(int[] col_map)(Code)(Java Doc) final public TObject getLastCellContent(int column)(Code)(Java Doc) final public TObject[] getLastCellContent(int[] col_map)(Code)(Java Doc) abstract public Variable getResolvedVariable(int column)(Code)(Java Doc) abstract public int getRowCount()(Code)(Java Doc) abstract SelectableScheme getSelectableSchemeFor(int column, int original_column, Table table)(Code)(Java Doc) final public TObject getSingleCellContent(int column)(Code)(Java Doc) final public TObject[] getSingleCellContent(int[] col_map)(Code)(Java Doc) final public TransactionSystem getSystem()(Code)(Java Doc) public TType getTTypeForColumn(int column)(Code)(Java Doc) public TType getTTypeForColumn(Variable v)(Code)(Java Doc) final public TableAccessState getTableAccessState()(Code)(Java Doc) final TableVariableResolver getVariableResolver()(Code)(Java Doc) abstract public boolean hasRootsLocked()(Code)(Java Doc) final public Table join(Table table)(Code)(Java Doc) abstract public void lockRoot(int lock_key)(Code)(Java Doc) final public VirtualTable orderByColumn(int col_index, boolean ascending)(Code)(Java Doc) final public VirtualTable orderByColumn(Variable column, boolean ascending)(Code)(Java Doc) final public VirtualTable orderByColumn(Variable column)(Code)(Java Doc) final public Table orderByColumns(int[] col_map)(Code)(Java Doc) final public IntegerVector orderedRowList(int[] col_map)(Code)(Java Doc) final public VirtualTable outside(Table rtable)(Code)(Java Doc) public void printGraph(PrintStream out, int indent)(Code)(Java Doc) final public Table rangeSelect(Variable col_var, SelectableRange[] ranges)(Code)(Java Doc) abstract void removeDataTableListener(DataTableListener listener)(Code)(Java Doc) abstract RawTableInformation resolveToRawTable(RawTableInformation info)(Code)(Java Doc) abstract public RowEnumeration rowEnumeration()(Code)(Java Doc) final public IntegerVector selectAll(int column)(Code)(Java Doc) final public IntegerVector selectAll()(Code)(Java Doc) final public IntegerVector selectFirst(int column)(Code)(Java Doc) final IntegerVector selectFromPattern(int column, Operator op, TObject ob)(Code)(Java Doc) final IntegerVector selectFromRegex(int column, Operator op, TObject ob)(Code)(Java Doc) final public IntegerVector selectLast(int column)(Code)(Java Doc) final public IntegerVector selectRange(int column, SelectableRange[] ranges)(Code)(Java Doc) final public IntegerVector selectRest(int column)(Code)(Java Doc) final IntegerVector selectRows(int[] cols, Operator op, TObject[] cells)(Code)(Java Doc) final IntegerVector selectRows(int column, Operator op, TObject cell)(Code)(Java Doc) IntegerVector selectRows(int column, TObject min_cell, TObject max_cell)(Code)(Java Doc) abstract void setToRowTableDomain(int column, IntegerVector row_set, TableDataSource ancestor)(Code)(Java Doc) final public Table simpleJoin(QueryContext context, Table table, Variable lhs_var, Operator op, Expression rhs)(Code)(Java Doc) final public Table simpleSelect(QueryContext context, Variable lhs_var, Operator op, Expression rhs)(Code)(Java Doc) final public Table singleRowSelect(int row_index)(Code)(Java Doc) public Map toMap()(Code)(Java Doc) public String toString()(Code)(Java Doc) final public Table union(Table table)(Code)(Java Doc) abstract public void unlockRoot(int lock_key)(Code)(Java Doc)
|
|
|