Package org.apache.poi.sl.usermodel
Interface TableShape<S extends Shape<S,P>,P extends TextParagraph<S,P,? extends TextRun>>
-
- All Superinterfaces:
PlaceableShape<S,P>
,Shape<S,P>
public interface TableShape<S extends Shape<S,P>,P extends TextParagraph<S,P,? extends TextRun>> extends Shape<S,P>, PlaceableShape<S,P>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TableCell<S,P>
getCell(int row, int col)
Gets a celldouble
getColumnWidth(int idx)
Gets the width (in points) of the n-th columnint
getNumberOfColumns()
Return the maximum number of columns.int
getNumberOfRows()
Return the number of rowsdouble
getRowHeight(int row)
Gets the row heightvoid
setColumnWidth(int idx, double width)
Sets the width (in points) of the n-th columnvoid
setRowHeight(int row, double height)
Sets the row height.-
Methods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
-
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getAnchor, getParent, getShapeId, getShapeName, getSheet
-
-
-
-
Method Detail
-
getNumberOfColumns
int getNumberOfColumns()
Return the maximum number of columns. If the table contains merged cells, the number of columns might be less than the maximum.- Returns:
- the maximum number of column
-
getNumberOfRows
int getNumberOfRows()
Return the number of rows- Returns:
- the row count
-
getCell
TableCell<S,P> getCell(int row, int col)
Gets a cell- Parameters:
row
- the row index (0-based)col
- the column index (0-based)- Returns:
- the cell or null if the cell doesn't exists, e.g. when accessing a merged cell or if the index is out of bounds
-
getColumnWidth
double getColumnWidth(int idx)
Gets the width (in points) of the n-th column- Parameters:
idx
- the column index (0-based)- Returns:
- the width (in points)
-
setColumnWidth
void setColumnWidth(int idx, double width)
Sets the width (in points) of the n-th column- Parameters:
idx
- the column index (0-based)width
- the width (in points)
-
getRowHeight
double getRowHeight(int row)
Gets the row height- Parameters:
row
- the row index (0-based)- Returns:
- the height (in points)
-
setRowHeight
void setRowHeight(int row, double height)
Sets the row height.- Parameters:
row
- the row index (0-based)height
- the height to set (in points)
-
-