Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
What Is jxl.jar 2.6.12
What is jxl.jar 2.6.12?
✍: fyicenter.com
jxl.jar 2.6.12 is the JAR file for Java Excel API 2.6.12,
which is a Java library for reading, writing and
modifying Microsoft Excel spreadsheet files.
JAR File Size and Download Location:
JAR name: jxl-2.6.12.jar Target JDK version: 1.6 Dependency: None File name: jxl.jar File size: 725735 bytes Release date: 24-Oct-2009 Download: Java Excel API Website.
Here are Java Source Code files for jxl-2.6.12.jar:
⏎ jxl/biff/CellFinder.java
/********************************************************************** * * Copyright (C) 2008 Andrew Khan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***************************************************************************/ package jxl.biff; import java.util.regex.Pattern; import java.util.regex.Matcher; import jxl.Sheet; import jxl.Cell; import jxl.CellType; import jxl.LabelCell; /** * Refactorisation to provide more sophisticated find cell by contents * functionality */ public class CellFinder { private Sheet sheet; public CellFinder(Sheet s) { sheet = s; } /** * Gets the cell whose contents match the string passed in. * If no match is found, then null is returned. The search is performed * on a row by row basis, so the lower the row number, the more * efficiently the algorithm will perform * * @param contents the string to match * @param firstCol the first column within the range * @param firstRow the first row of the range * @param lastCol the last column within the range * @param lastRow the last row within the range * @param reverse indicates whether to perform a reverse search or not * @return the Cell whose contents match the parameter, null if not found */ public Cell findCell(String contents, int firstCol, int firstRow, int lastCol, int lastRow, boolean reverse) { Cell cell = null; boolean found = false; int numCols = lastCol - firstCol; int numRows = lastRow - firstRow; int row1 = reverse ? lastRow : firstRow; int row2 = reverse ? firstRow : lastRow; int col1 = reverse ? lastCol : firstCol; int col2 = reverse ? firstCol : lastCol; int inc = reverse ? -1 : 1; for (int i = 0; i <= numCols && found == false; i++) { for (int j = 0; j <= numRows && found == false; j++) { int curCol = col1 + i * inc; int curRow = row1 + j * inc; if (curCol < sheet.getColumns() && curRow < sheet.getRows()) { Cell c = sheet.getCell(curCol, curRow); if (c.getType() != CellType.EMPTY) { if (c.getContents().equals(contents)) { cell = c; found = true; } } } } } return cell; } /** * Finds a cell within a given range of cells * * @param contents the string to match * @return the Cell whose contents match the parameter, null if not found */ public Cell findCell(String contents) { Cell cell = null; boolean found = false; for (int i = 0 ; i < sheet.getRows() && found == false; i++) { Cell[] row = sheet.getRow(i); for (int j = 0 ; j < row.length && found == false; j++) { if (row[j].getContents().equals(contents)) { cell = row[j]; found = true; } } } return cell; } /** * Gets the cell whose contents match the regular expressionstring passed in. * If no match is found, then null is returned. The search is performed * on a row by row basis, so the lower the row number, the more * efficiently the algorithm will perform * * @param pattern the regular expression string to match * @param firstCol the first column within the range * @param firstRow the first row of the range * @param lastCol the last column within the range * @param lastRow the last row within the range * @param reverse indicates whether to perform a reverse search or not * @return the Cell whose contents match the parameter, null if not found */ public Cell findCell(Pattern pattern, int firstCol, int firstRow, int lastCol, int lastRow, boolean reverse) { Cell cell = null; boolean found = false; int numCols = lastCol - firstCol; int numRows = lastRow - firstRow; int row1 = reverse ? lastRow : firstRow; int row2 = reverse ? firstRow : lastRow; int col1 = reverse ? lastCol : firstCol; int col2 = reverse ? firstCol : lastCol; int inc = reverse ? -1 : 1; for (int i = 0; i <= numCols && found == false; i++) { for (int j = 0; j <= numRows && found == false; j++) { int curCol = col1 + i * inc; int curRow = row1 + j * inc; if (curCol < sheet.getColumns() && curRow < sheet.getRows()) { Cell c = sheet.getCell(curCol, curRow); if (c.getType() != CellType.EMPTY) { Matcher m = pattern.matcher(c.getContents()); if (m.matches()) { cell = c; found = true; } } } } } return cell; } /** * Gets the cell whose contents match the string passed in. * If no match is found, then null is returned. The search is performed * on a row by row basis, so the lower the row number, the more * efficiently the algorithm will perform. This method differs * from the findCell methods in that only cells with labels are * queried - all numerical cells are ignored. This should therefore * improve performance. * * @param contents the string to match * @return the Cell whose contents match the paramter, null if not found */ public LabelCell findLabelCell(String contents) { LabelCell cell = null; boolean found = false; for (int i = 0; i < sheet.getRows() && !found; i++) { Cell[] row = sheet.getRow(i); for (int j = 0; j < row.length && !found; j++) { if ((row[j].getType() == CellType.LABEL || row[j].getType() == CellType.STRING_FORMULA) && row[j].getContents().equals(contents)) { cell = (LabelCell) row[j]; found = true; } } } return cell; } }
⏎ jxl/biff/CellFinder.java
Or download all of them as a single archive file:
File name: jxl-2.6.12-src.zip File size: 824057 bytes Release date: 2009-10-24 Download
⇐ What Is jexcelapi_2_6_12.zip
2017-06-09, 103568👍, 6💬
Popular Posts:
How to download and install JDK (Java Development Kit) 6? If you want to write Java applications, yo...
JDK 11 jrt-fs.jar is the JAR file for JDK 11 JRT-FS (Java RunTime - File System) defined in the "jdk...
JDK 11 jdk.jconsole.jmod is the JMOD file for JDK 11 JConsole tool, which can be invoked by the "jco...
JDK 11 jdk.localedata.jmod is the JMOD file for JDK 11 Localedata module. JDK 11 Locale Data module ...
JDK 11 jdk.internal.le.jmod is the JMOD file for JDK 11 Internal Line Editing module. JDK 11 Interna...