Package com.mckoi.database
Class GTTableColumnsDataSource
- java.lang.Object
-
- com.mckoi.database.GTDataSource
-
- com.mckoi.database.GTTableColumnsDataSource
-
- All Implemented Interfaces:
MutableTableDataSource,TableDataSource
final class GTTableColumnsDataSource extends GTDataSource
An implementation of MutableTableDataSource that presents information about the columns of all tables in all schema.NOTE: This is not designed to be a long kept object. It must not last beyond the lifetime of a transaction.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static DataTableDefDEF_DATA_TABLE_DEFThe data table def that describes this table of data source.private introw_countThe number of rows in this table.private TransactiontransactionThe transaction that is the view of this information.private DataTableDef[]visible_tablesThe list of all DataTableDef visible to the transaction.
-
Constructor Summary
Constructors Constructor Description GTTableColumnsDataSource(Transaction transaction)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Disposes this table data source.TObjectgetCellContents(int column, int row)Returns an object that represents the information in the given cell in the table.DataTableDefgetDataTableDef()Returns a DataTableDef object that defines the layout of the table that this data is in.intgetRowCount()Returns the number of rows in this data source.GTTableColumnsDataSourceinit()Initialize the data source.-
Methods inherited from class com.mckoi.database.GTDataSource
addRootLock, addRow, booleanColumn, columnValue, constraintIntegrityCheck, dateColumn, flushIndexChanges, getColumnScheme, getJournal, getSystem, numericColumn, removeRootLock, removeRow, rowEnumeration, stringColumn, updateRow
-
-
-
-
Field Detail
-
transaction
private Transaction transaction
The transaction that is the view of this information.
-
visible_tables
private DataTableDef[] visible_tables
The list of all DataTableDef visible to the transaction.
-
row_count
private int row_count
The number of rows in this table.
-
DEF_DATA_TABLE_DEF
static final DataTableDef DEF_DATA_TABLE_DEF
The data table def that describes this table of data source.
-
-
Constructor Detail
-
GTTableColumnsDataSource
public GTTableColumnsDataSource(Transaction transaction)
Constructor.
-
-
Method Detail
-
init
public GTTableColumnsDataSource init()
Initialize the data source.
-
getDataTableDef
public DataTableDef getDataTableDef()
Description copied from interface:TableDataSourceReturns a DataTableDef object that defines the layout of the table that this data is in.This may return 'null' if there is no table definition.
- Specified by:
getDataTableDefin interfaceTableDataSource- Specified by:
getDataTableDefin classGTDataSource
-
getRowCount
public int getRowCount()
Description copied from interface:TableDataSourceReturns the number of rows in this data source.NOTE: Returns 'n' - getCellContents(column, row) is not necessarily valid for row = [0..n]. Use 'rowEnumerator' to generate an iterator for valid row values over this data source.
- Specified by:
getRowCountin interfaceTableDataSource- Specified by:
getRowCountin classGTDataSource
-
getCellContents
public TObject getCellContents(int column, int row)
Description copied from interface:TableDataSourceReturns an object that represents the information in the given cell in the table. This may be an expensive operation, so calls to it should be kept to a minimum. Note that the offset between two rows is not necessarily 1. Use 'rowEnumeration' to create a row iterator.- Specified by:
getCellContentsin interfaceTableDataSource- Specified by:
getCellContentsin classGTDataSource
-
dispose
public void dispose()
Description copied from interface:MutableTableDataSourceDisposes this table data source. After this method is called, most use of this object is undefined, except for the 'getCellContent' and 'compareCellContent' methods which are valid provided the source is under a root lock.- Specified by:
disposein interfaceMutableTableDataSource- Overrides:
disposein classGTDataSource
-
-