Package com.mckoi.database
Class GTPrivMapDataSource
- java.lang.Object
-
- com.mckoi.database.GTDataSource
-
- com.mckoi.database.GTPrivMapDataSource
-
- All Implemented Interfaces:
MutableTableDataSource
,TableDataSource
public class GTPrivMapDataSource extends GTDataSource
A GTDataSource that maps a Privs 11-bit set to strings that represent the priv in human understandable string. Each 11-bit priv set contains 12 entries for each bit that was set.This table provides a convenient way to join the system grant table and 'expand' the privs that are allowed though it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
GTPrivMapDataSource.PrivMapSearch
A SelectableScheme that makes searching on the 'priv_bit' column a lot less painless!
-
Field Summary
Fields Modifier and Type Field Description private static int
BIT_COUNT
Number of bits.(package private) static DataTableDef
DEF_DATA_TABLE_DEF
The data table def that describes this table of data source.
-
Constructor Summary
Constructors Constructor Description GTPrivMapDataSource(DatabaseConnection connection)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TObject
getCellContents(int column, int row)
Returns an object that represents the information in the given cell in the table.SelectableScheme
getColumnScheme(int column)
Returns the SelectableScheme that we use as an index for rows in the given column of this source.DataTableDef
getDataTableDef()
Returns a DataTableDef object that defines the layout of the table that this data is in.int
getRowCount()
Returns the number of rows in this data source.-
Methods inherited from class com.mckoi.database.GTDataSource
addRootLock, addRow, booleanColumn, columnValue, constraintIntegrityCheck, dateColumn, dispose, flushIndexChanges, getJournal, getSystem, numericColumn, removeRootLock, removeRow, rowEnumeration, stringColumn, updateRow
-
-
-
-
Field Detail
-
BIT_COUNT
private static int BIT_COUNT
Number of bits.
-
DEF_DATA_TABLE_DEF
static final DataTableDef DEF_DATA_TABLE_DEF
The data table def that describes this table of data source.
-
-
Constructor Detail
-
GTPrivMapDataSource
public GTPrivMapDataSource(DatabaseConnection connection)
Constructor.
-
-
Method Detail
-
getDataTableDef
public DataTableDef getDataTableDef()
Description copied from interface:TableDataSource
Returns 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:
getDataTableDef
in interfaceTableDataSource
- Specified by:
getDataTableDef
in classGTDataSource
-
getRowCount
public int getRowCount()
Description copied from interface:TableDataSource
Returns 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:
getRowCount
in interfaceTableDataSource
- Specified by:
getRowCount
in classGTDataSource
-
getCellContents
public TObject getCellContents(int column, int row)
Description copied from interface:TableDataSource
Returns 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:
getCellContents
in interfaceTableDataSource
- Specified by:
getCellContents
in classGTDataSource
-
getColumnScheme
public SelectableScheme getColumnScheme(int column)
Description copied from interface:TableDataSource
Returns the SelectableScheme that we use as an index for rows in the given column of this source. The SelectableScheme is used to determine the relationship between cells in a column.ISSUE: The scheme returned here should not have the 'insert' or 'remove' methods called (ie. it should be considered immutable). Perhaps we should make a MutableSelectableScheme interface to guarentee this constraint.
- Specified by:
getColumnScheme
in interfaceTableDataSource
- Overrides:
getColumnScheme
in classGTDataSource
-
-