⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 workbookcellfinderimpl.java

📁 一个java生成自动生成Excel
💻 JAVA
字号:
package net.sf.jxls.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.poi.hssf.util.CellReference;

/**
 * Simple implementation of {@link net.sf.jxls.controller.WorkbookCellFinder} based on SheetCellFinder mapping to corresponding worksheets
 * @author Leonid Vysochyn
 */
public class WorkbookCellFinderImpl implements WorkbookCellFinder {

    Map sheetCellFinderMapping = new HashMap();

    public WorkbookCellFinderImpl() {
    }

    public WorkbookCellFinderImpl(Map sheetCellFinderMapping) {
        this.sheetCellFinderMapping = sheetCellFinderMapping;
    }

    public List findCell(String sheetName, String cellName) {
        CellReference cellReference = new CellReference( cellName );
        int colNum = cellReference.getCol();
        int rowNum = cellReference.getRow();
        return findCell( sheetName, rowNum, colNum );
    }

    public List findCell(String sheetName, int rowNum, int colNum) {
        if( !sheetCellFinderMapping.containsKey( sheetName ) ){
            throw new IllegalArgumentException("Can't find sheet with name " + sheetName + " used in formula cell reference");
        }
        return ((SheetCellFinder)sheetCellFinderMapping.get( sheetName )).findCell( rowNum, colNum );
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -