Package io.keikai.model.impl
Class TableImpl
- java.lang.Object
-
- io.keikai.model.impl.AbstractTableAdv
-
- io.keikai.model.impl.TableImpl
-
- All Implemented Interfaces:
LinkedModelObject,STable,Serializable,Table
public class TableImpl extends AbstractTableAdv implements LinkedModelObject
- Since:
- 3.8.0
- Author:
- henri
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTableImpl.DummyTable
-
Field Summary
-
Fields inherited from interface org.apache.poi.ss.usermodel.Table
isStructuredReference
-
-
Constructor Summary
Constructors Constructor Description TableImpl(AbstractBookAdv book, String name, String displayName, SheetRegion region, int headerRowCount, int totalsRowCount, STableStyleInfo info)TableImpl(AbstractBookAdv book, String name, String displayName, SheetRegion region, int headerRowCount, int totalsRowCount, STableStyleInfo info, boolean totalsRowShown)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(STableColumn column)voidcheckOrphan()booleancontains(CellReference cell)checks if the given cell is part of the table.SAutoFiltercreateAutoFilter()Creates a new auto filter for this table the old one will be drop directly.voiddeleteAutoFilter()Delete current autofilter if it hasvoiddeleteCols(int col1, int col2)voiddeleteRows(int row1, int row2)voiddestroy()Destroy / release this model object, for example all the dependency, parent linking.voidenableAutoFilter(boolean enable)intfindColumnIndex(String columnHeader)Returns the index of a given named column in the table (names are case insensitive in XSSF).SheetRegiongetAllRegion()SAutoFiltergetAutoFilter()Gets the auto filter information if there is.SBookgetBook()SCellStylegetCellStyle(int row, int col)STableColumngetColumnAt(int colIdx)List<STableColumn>getColumns()SheetRegiongetColumnsRegion(String columnName1, String columnName2)SheetRegiongetDataRegion()StringgetDisplayName()intgetEndColIndex()Get the bottom-right column index on the sheetintgetEndRowIndex()Get the bottom-right row indexintgetHeaderRowCount()SheetRegiongetHeadersRegion()SheetRegiongetItemRegion(TablePtg.Item item, int rowIdx)StringgetName()Get the name of the table.StringgetSheetName()Returns the sheet name that the table belongs to.intgetStartColIndex()Get the top-left column index relative to the sheetintgetStartRowIndex()Get the top-left row index on the sheetTableStyleInfogetStyle()StringgetStyleName()STableStyleInfogetTableStyleInfo()SheetRegiongetThisRowRegion(int rowIdx)SheetRegiongetTotalsRegion()intgetTotalsRowCount()voidinsertCols(int col1, int col2, boolean insertLeft)voidinsertRows(int row1, int row2)booleanisHasTotalsRow()Note: This is misleading.voidrefreshFilter()voidrefreshStyle()voidsetDisplayName(String name)voidsetHeaderRowCount(int count)voidsetName(String newname)voidsetTableStyle(STableStyleInfo style)voidsetTotalsRowCount(int count)booleanshiftCols(int diff)booleanshiftRows(int diff)
-
-
-
Constructor Detail
-
TableImpl
public TableImpl(AbstractBookAdv book, String name, String displayName, SheetRegion region, int headerRowCount, int totalsRowCount, STableStyleInfo info)
-
TableImpl
public TableImpl(AbstractBookAdv book, String name, String displayName, SheetRegion region, int headerRowCount, int totalsRowCount, STableStyleInfo info, boolean totalsRowShown)
-
-
Method Detail
-
getColumns
public List<STableColumn> getColumns()
- Specified by:
getColumnsin interfaceSTable
-
addColumn
public void addColumn(STableColumn column)
-
getTableStyleInfo
public STableStyleInfo getTableStyleInfo()
- Specified by:
getTableStyleInfoin interfaceSTable
-
setTableStyle
public void setTableStyle(STableStyleInfo style)
-
getTotalsRowCount
public int getTotalsRowCount()
- Specified by:
getTotalsRowCountin interfaceSTable- Specified by:
getTotalsRowCountin interfaceTable- 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.
-
getHeaderRowCount
public int getHeaderRowCount()
- Specified by:
getHeaderRowCountin interfaceSTable- Specified by:
getHeaderRowCountin interfaceTable- Returns:
- 0 for no header rows, 1 for table headers shown. Values > 1 might be used by Excel for pivot tables?
-
setTotalsRowCount
public void setTotalsRowCount(int count)
- Specified by:
setTotalsRowCountin interfaceSTable
-
setHeaderRowCount
public void setHeaderRowCount(int count)
- Specified by:
setHeaderRowCountin interfaceSTable
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayNamein interfaceSTable
-
setDisplayName
public void setDisplayName(String name)
- Specified by:
setDisplayNamein interfaceSTable
-
getDataRegion
public SheetRegion getDataRegion()
- Specified by:
getDataRegionin interfaceSTable
-
getColumnsRegion
public SheetRegion getColumnsRegion(String columnName1, String columnName2)
- Specified by:
getColumnsRegionin interfaceSTable
-
getHeadersRegion
public SheetRegion getHeadersRegion()
- Specified by:
getHeadersRegionin interfaceSTable
-
getTotalsRegion
public SheetRegion getTotalsRegion()
- Specified by:
getTotalsRegionin interfaceSTable
-
getThisRowRegion
public SheetRegion getThisRowRegion(int rowIdx)
- Specified by:
getThisRowRegionin interfaceSTable
-
getItemRegion
public SheetRegion getItemRegion(TablePtg.Item item, int rowIdx)
- Specified by:
getItemRegionin interfaceSTable
-
destroy
public void destroy()
Description copied from interface:LinkedModelObjectDestroy / release this model object, for example all the dependency, parent linking. this method has to be called before remove this linking from parent object- Specified by:
destroyin interfaceLinkedModelObject
-
checkOrphan
public void checkOrphan()
- Specified by:
checkOrphanin interfaceLinkedModelObject
-
getColumnAt
public STableColumn getColumnAt(int colIdx)
- Specified by:
getColumnAtin interfaceSTable
-
getCellStyle
public SCellStyle getCellStyle(int row, int col)
- Specified by:
getCellStylein classAbstractTableAdv
-
deleteRows
public void deleteRows(int row1, int row2)- Specified by:
deleteRowsin classAbstractTableAdv
-
deleteCols
public void deleteCols(int col1, int col2)- Specified by:
deleteColsin classAbstractTableAdv
-
shiftCols
public boolean shiftCols(int diff)
- Specified by:
shiftColsin classAbstractTableAdv
-
shiftRows
public boolean shiftRows(int diff)
- Specified by:
shiftRowsin classAbstractTableAdv
-
insertRows
public void insertRows(int row1, int row2)- Specified by:
insertRowsin classAbstractTableAdv
-
insertCols
public void insertCols(int col1, int col2, boolean insertLeft)- Specified by:
insertColsin classAbstractTableAdv
-
enableAutoFilter
public void enableAutoFilter(boolean enable)
- Specified by:
enableAutoFilterin interfaceSTable
-
getAutoFilter
public SAutoFilter getAutoFilter()
Description copied from interface:STableGets the auto filter information if there is.- Specified by:
getAutoFilterin interfaceSTable- Returns:
- the auto filter, or null if not found
-
createAutoFilter
public SAutoFilter createAutoFilter()
Description copied from interface:STableCreates a new auto filter for this table the old one will be drop directly.- Specified by:
createAutoFilterin interfaceSTable- Returns:
- the new auto filter.
-
deleteAutoFilter
public void deleteAutoFilter()
Description copied from interface:STableDelete current autofilter if it has- Specified by:
deleteAutoFilterin interfaceSTable
-
refreshFilter
public void refreshFilter()
- Specified by:
refreshFilterin classAbstractTableAdv
-
refreshStyle
public void refreshStyle()
- Specified by:
refreshStylein classAbstractTableAdv
-
getStyle
public TableStyleInfo getStyle()
-
contains
public boolean contains(CellReference cell)
Description copied from interface:Tablechecks if the given cell is part of the table. Includes checking that they are on the same sheet.
-
getAllRegion
public SheetRegion getAllRegion()
- Specified by:
getAllRegionin interfaceSTable
-
getStartColIndex
public int getStartColIndex()
Description copied from interface:TableGet the top-left column index relative to the sheet- Specified by:
getStartColIndexin interfaceTable- Returns:
- table start column index on sheet
-
getStartRowIndex
public int getStartRowIndex()
Description copied from interface:TableGet the top-left row index on the sheet- Specified by:
getStartRowIndexin interfaceTable- Returns:
- table start row index on sheet
-
getEndColIndex
public int getEndColIndex()
Description copied from interface:TableGet the bottom-right column index on the sheet- Specified by:
getEndColIndexin interfaceTable- Returns:
- table end column index on sheet
-
getEndRowIndex
public int getEndRowIndex()
Description copied from interface:TableGet the bottom-right row index- Specified by:
getEndRowIndexin interfaceTable- Returns:
- table end row index on sheet
-
getStyleName
public String getStyleName()
- Specified by:
getStyleNamein interfaceTable- Returns:
- name of the table style, if there is one. May be a built-in name or user-defined.
-
findColumnIndex
public int findColumnIndex(String columnHeader)
Description copied from interface:TableReturns 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.- Specified by:
findColumnIndexin interfaceTable- Parameters:
columnHeader- the column header name to get the table column index of- Returns:
- column index corresponding to
columnHeader
-
getSheetName
public String getSheetName()
Description copied from interface:TableReturns the sheet name that the table belongs to.- Specified by:
getSheetNamein interfaceTable- Returns:
- sheet name
-
isHasTotalsRow
public boolean isHasTotalsRow()
Description copied from interface:TableNote: 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. UseTable.getTotalsRowCount()> 0 to decide whether or not the totals row is visible.- Specified by:
isHasTotalsRowin interfaceTable- Returns:
- true if a totals row has ever been shown for this table
- See Also:
Table.getTotalsRowCount()
-
-