org.apache.poi.xssf.usermodel.XSSFTable.getColumnCount()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.apache.poi.xssf.usermodel.XSSFTable.getColumnCount()方法的一些代码示例,展示了XSSFTable.getColumnCount()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSSFTable.getColumnCount()方法的具体详情如下:
包路径:org.apache.poi.xssf.usermodel.XSSFTable
类名称:XSSFTable
方法名:getColumnCount

XSSFTable.getColumnCount介绍

[英]Get the total number of columns in this table.
[中]获取此表中的列总数。

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Add a new column to the right end of the table.
 * 
 * @param columnName
 *            the unique name of the column, must not be {@code null}
 * @return the created table column
 * @since 4.0.0
 */
public XSSFTableColumn createColumn(String columnName) {
  return createColumn(columnName, getColumnCount());
}

代码示例来源:origin: org.apache.poi/poi-ooxml

if (columnMap == null) {
  final int count = getColumnCount();
  columnMap = new HashMap<>(count * 3 / 2);

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Remove a column from the table.
 *
 * @param columnIndex
 *            the 0-based position of the column in the table
 * @throws IllegalArgumentException
 *             if no column at the index exists or if the table has only a
 *             single column
 * @since 4.0.0
 */
public void removeColumn(int columnIndex) {
  if (columnIndex < 0 || columnIndex > getColumnCount() - 1) {
    throw new IllegalArgumentException("Column index out of bounds");
  }
  
  if(getColumnCount() == 1) {
    throw new IllegalArgumentException("Table must have at least one column");
  }
  
  CTTableColumns tableColumns = ctTable.getTableColumns();
  tableColumns.removeTableColumn(columnIndex);
  tableColumns.setCount(tableColumns.getTableColumnList().size());
  updateReferences();
  updateHeaders();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

int columnCount = getColumnCount();
int newColumnCount = (tableArea.getLastCell().getCol() - tableArea.getFirstCell().getCol()) + 1;
if (newColumnCount > columnCount) {

代码示例来源:origin: org.apache.poi/poi-ooxml

int columnCount = getColumnCount();
if(columnIndex < 0 || columnIndex > columnCount) {
  throw new IllegalArgumentException("Column index out of bounds");

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Add a new column to the right end of the table.
 * 
 * @param columnName
 *            the unique name of the column, must not be {@code null}
 * @return the created table column
 * @since 4.0.0
 */
public XSSFTableColumn createColumn(String columnName) {
  return createColumn(columnName, getColumnCount());
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Remove a column from the table.
 *
 * @param columnIndex
 *            the 0-based position of the column in the table
 * @throws IllegalArgumentException
 *             if no column at the index exists or if the table has only a
 *             single column
 * @since 4.0.0
 */
public void removeColumn(int columnIndex) {
  if (columnIndex < 0 || columnIndex > getColumnCount() - 1) {
    throw new IllegalArgumentException("Column index out of bounds");
  }
  
  if(getColumnCount() == 1) {
    throw new IllegalArgumentException("Table must have at least one column");
  }
  
  CTTableColumns tableColumns = ctTable.getTableColumns();
  tableColumns.removeTableColumn(columnIndex);
  tableColumns.setCount(tableColumns.getTableColumnList().size());
  updateReferences();
  updateHeaders();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

if (columnMap == null) {
  final int count = getColumnCount();
  columnMap = new HashMap<>(count * 3 / 2);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

int columnCount = getColumnCount();
int newColumnCount = (tableArea.getLastCell().getCol() - tableArea.getFirstCell().getCol()) + 1;
if (newColumnCount > columnCount) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

int columnCount = getColumnCount();
if(columnIndex < 0 || columnIndex > columnCount) {
  throw new IllegalArgumentException("Column index out of bounds");

相关文章