Class SimpleLogicalTable

    • Constructor Detail

      • SimpleLogicalTable

        public SimpleLogicalTable​(IGridTable table)
    • Method Detail

      • getWidth

        public int getWidth()
        Returns:
        width of the table
      • getHeight

        public int getHeight()
        Returns:
        height of the table
      • findColumnStart

        public int findColumnStart​(int gridOffset)
        Description copied from interface: ILogicalTable
        Calculates # of the column starting exactly at gridOffset. Throws TableException if gridOffset does not match any column's start.
        Returns:
      • findRowStart

        public int findRowStart​(int gridOffset)
        Description copied from interface: ILogicalTable
        Calculates # of the row starting exactly at gridOffset. Throws TableException if gridOffset does not match any row's start.
        Returns:
      • getColumnWidth

        public int getColumnWidth​(int column)
        Parameters:
        column - index of the column
        Returns:
        width of the column by its index.
      • getRowHeight

        public int getRowHeight​(int row)
        Parameters:
        row - index of the row
        Returns:
        height of the row by its index.
      • getSubtable

        public ILogicalTable getSubtable​(int column,
                                         int row,
                                         int width,
                                         int height)
        This method consider that this table doesn`t have merged regions inside itself. In general it is not true. Current Openl parsing implementation, correctly handles such cases. If you need the trully ILogicalTable, with correctly calculated logical columns and rows, you may get the source table, by calling ILogicalTable.getSource() extract the region you need by calling ITable.getSubtable(int, int, int, int) and create ILogicalTable by calling LogicalTableHelper.logicalTable(IGridTable). This is optimised implementation because of time overhead when checking for each table is it really logical or not.
        For test see SimpleLogicalTableTest.
        Parameters:
        column - from which we want to take the subtable, including this.
        row - from which we want to take the subtable, including this.
        width - of the needed table.
        height - of the needed table.
        Returns:
        SimpleLogicalTable
      • getCell

        public ICell getCell​(int column,
                             int row)
        Returns:
        cell form the given column and row.