Class TableAccessState


  • public final class TableAccessState
    extends java.lang.Object
    This class provides very limited access to a Table object. The purpose of this object is to define the functionality of a table when the root table(s) are locked via the 'Table.lockRoot(int)' method, and when the Table is no longer READ or WRITE locked via the 'LockingMechanism' system. During these conditions, the table is in a semi-volatile state, so this class provides a safe way to access the table without having to worry about using some functionality of Table which isn't supported at this time.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean been_locked
      Set to true when the table is first locked.
      private Table table
      The underlying Table object.
    • Constructor Summary

      Constructors 
      Constructor Description
      TableAccessState​(Table table)
      The Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      TObject getCellContents​(int column, int row)
      Returns the cell at the given row/column coordinates in the table.
      DataTableDef getDataTableDef()
      Returns the DataTableDef object that contains information on the columns of the table.
      Variable getResolvedVariable​(int column)
      Returns the TableName of the given column of this table.
      void lockRoot​(int key)
      Locks the root rows of the table.
      void unlockRoot​(int key)
      Unlocks the root rows of the table.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • table

        private Table table
        The underlying Table object.
      • been_locked

        private boolean been_locked
        Set to true when the table is first locked.
    • Constructor Detail

      • TableAccessState

        TableAccessState​(Table table)
        The Constructor.
    • Method Detail

      • getCellContents

        public TObject getCellContents​(int column,
                                       int row)
        Returns the cell at the given row/column coordinates in the table. This method is valid because it doesn't use any of the SelectableScheme information in any of its parent tables which could change at any time when there is no READ or WRITE lock on the table.
      • getDataTableDef

        public DataTableDef getDataTableDef()
        Returns the DataTableDef object that contains information on the columns of the table.
      • getResolvedVariable

        public Variable getResolvedVariable​(int column)
        Returns the TableName of the given column of this table. This, together with 'getDataTableDef' is used to find the fully qualified name of a column of the table.
      • lockRoot

        public void lockRoot​(int key)
        Locks the root rows of the table. This method is a bit of a HACK - why should the contract include being able to lock the root rows? This method only permits the roots to be locked once.
      • unlockRoot

        public void unlockRoot​(int key)
        Unlocks the root rows of the table.