Package org.openl.rules.table
Class LogicalTable
- java.lang.Object
-
- org.openl.rules.table.ALogicalTable
-
- org.openl.rules.table.LogicalTable
-
- All Implemented Interfaces:
ILogicalTable,ITable<ILogicalTable>
public class LogicalTable extends ALogicalTable
Fully implementation forILogicalTableinterface.
Logical Table consists of logical columns and rows (created as a result of merged cells). Each merged region is taken as one cell.
UseLogicalTableHelper.logicalTable(IGridTable)LogicalTableHelper.logicalTable(IGridTable, ILogicalTable, ILogicalTable)to correctly construct this object.- Author:
- snshor
-
-
Constructor Summary
Constructors Constructor Description LogicalTable(IGridTable table, int[] columnOffset, int[] rowOffset)LogicalTable(IGridTable table, int width, int height)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intfindColumnStart(int gridOffset)Calculates # of the column starting exactly at gridOffset.intfindRowStart(int gridOffset)Calculates # of the row starting exactly at gridOffset.ICellgetCell(int column, int row)int[]getColumnOffset()intgetColumnWidth(int column)intgetHeight()intgetRowHeight(int row)int[]getRowOffset()ILogicalTablegetSubtable(int column, int row, int width, int height)intgetWidth()-
Methods inherited from class org.openl.rules.table.ALogicalTable
getColumn, getColumns, getColumns, getRow, getRows, getRows, getSource, isNormalOrientation, toString, transpose
-
-
-
-
Constructor Detail
-
LogicalTable
public LogicalTable(IGridTable table, int width, int height)
-
LogicalTable
public LogicalTable(IGridTable table, int[] columnOffset, int[] rowOffset)
-
-
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:ILogicalTableCalculates # 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:ILogicalTableCalculates # 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)
- Parameters:
column- from which we want to take the subtable, including border.row- from which we want to take the subtable, including border.width- of the needed table.height- of the needed table.- Returns:
- the subtable of this table.
-
getRowOffset
public int[] getRowOffset()
-
getColumnOffset
public int[] getColumnOffset()
-
getCell
public ICell getCell(int column, int row)
- Returns:
- cell form the given column and row.
-
-