Class 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.

    • 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

      • 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 interface TableDataSource
        Specified by:
        getRowCount in class GTDataSource
      • 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 interface TableDataSource
        Specified by:
        getCellContents in class GTDataSource
      • 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 interface TableDataSource
        Overrides:
        getColumnScheme in class GTDataSource