Package org.apache.poi.ss.usermodel
Interface Table
-
- All Known Implementing Classes:
XSSFTable
public interface Table
XSSF Only! High level abstraction of table in a workbook.
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
isStructuredReference
Regular expression matching a Structured Reference (Table syntax) for XSSF table expressions.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
contains(Cell cell)
checks if the given cell is part of the table.boolean
contains(CellReference cell)
checks if the given cell is part of the table.int
findColumnIndex(String columnHeader)
Returns the index of a given named column in the table (names are case insensitive in XSSF).int
getEndColIndex()
Get the bottom-right column index on the sheetint
getEndRowIndex()
Get the bottom-right row indexint
getHeaderRowCount()
String
getName()
Get the name of the table.String
getSheetName()
Returns the sheet name that the table belongs to.int
getStartColIndex()
Get the top-left column index relative to the sheetint
getStartRowIndex()
Get the top-left row index on the sheetTableStyleInfo
getStyle()
String
getStyleName()
int
getTotalsRowCount()
boolean
isHasTotalsRow()
Note: This is misleading.
-
-
-
Field Detail
-
isStructuredReference
static final Pattern isStructuredReference
Regular expression matching a Structured Reference (Table syntax) for XSSF table expressions. Public for unit tests- See Also:
- Excel Structured Reference Syntax
-
-
Method Detail
-
getStartColIndex
int getStartColIndex()
Get the top-left column index relative to the sheet- Returns:
- table start column index on sheet
-
getStartRowIndex
int getStartRowIndex()
Get the top-left row index on the sheet- Returns:
- table start row index on sheet
-
getEndColIndex
int getEndColIndex()
Get the bottom-right column index on the sheet- Returns:
- table end column index on sheet
-
getEndRowIndex
int getEndRowIndex()
Get the bottom-right row index- Returns:
- table end row index on sheet
-
getName
String getName()
Get the name of the table.- Returns:
- table name
-
getStyleName
String getStyleName()
- Returns:
- name of the table style, if there is one. May be a built-in name or user-defined.
- Since:
- 3.17 beta 1
-
findColumnIndex
int findColumnIndex(String columnHeader)
Returns the index of a given named column in the table (names are case insensitive in XSSF). Note this list is lazily loaded and cached for performance. Changes to the underlying table structure are not reflected in later calls unlessXSSFTable.updateHeaders()
is called to reset the cache.- Parameters:
columnHeader
- the column header name to get the table column index of- Returns:
- column index corresponding to
columnHeader
-
getSheetName
String getSheetName()
Returns the sheet name that the table belongs to.- Returns:
- sheet name
-
isHasTotalsRow
boolean isHasTotalsRow()
Note: This is misleading. The OOXML spec indicates this is true if the totals row has ever been shown, not whether or not it is currently displayed. UsegetTotalsRowCount()
> 0 to decide whether or not the totals row is visible.- Returns:
- true if a totals row has ever been shown for this table
- Since:
- 3.15 beta 2
- See Also:
getTotalsRowCount()
-
getTotalsRowCount
int getTotalsRowCount()
- Returns:
- 0 for no totals rows, 1 for totals row shown. Values > 1 are not currently used by Excel up through 2016, and the OOXML spec doesn't define how they would be implemented.
- Since:
- 3.17 beta 1
-
getHeaderRowCount
int getHeaderRowCount()
- Returns:
- 0 for no header rows, 1 for table headers shown. Values > 1 might be used by Excel for pivot tables?
- Since:
- 3.17 beta 1
-
getStyle
TableStyleInfo getStyle()
- Returns:
- TableStyleInfo for this instance
- Since:
- 3.17 beta 1
-
contains
default boolean contains(Cell cell)
checks if the given cell is part of the table. Includes checking that they are on the same sheet.- Parameters:
cell
-- Returns:
- true if the table and cell are on the same sheet and the cell is within the table range.
- Since:
- 3.17 beta 1
- See Also:
(prefered, faster execution and handles undefined cells)
-
contains
boolean contains(CellReference cell)
checks if the given cell is part of the table. Includes checking that they are on the same sheet.- Parameters:
cell
- reference to a possibly undefined cell location- Returns:
- true if the table and cell are on the same sheet and the cell is within the table range.
- Since:
- 3.17 beta 1
-
-