|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ExcelReader
This class is a simple and a fast way to use the Andy Khan's excelread library.
Using ExcelReader you can read data from excel sequentially or specifing positions of
the cell to read.
Sequential reading allows you to use excel sheets like sequential text files.
Each value is read using the getValue() method without passing to it any parameters.
The ExcelReader class gets values one by one until the eof() method returns true.
When you know the structure of your data or you are using a table as input,
the direct reading method can be used. You get values asking ExcelRead to return
the value of each cell giving its (row, col) position.
The row and column index start both from 0 value.
Constructor Summary | |
ExcelReader(java.lang.String fileName)
Opens the file and sets the first excel sheet the current sheet. |
|
ExcelReader(java.lang.String fileName,
boolean skipEmptyCells)
Opens the file and sets the first excel sheet the current sheet. If skipEmptyCells parameter is set to false, during sequential reading each empty cell read will be considered as blank string or a 0 value. |
|
ExcelReader(java.lang.String fileName,
boolean skipEmptyCells,
java.lang.String sheetName)
This constuctor allows you to open and to select directly the source sheet. |
Method Summary | |
boolean |
checkForLabelCell()
Checks if the next cell in reading sequence contains a label (leaving unchanged the counter) |
boolean |
checkForLabelCell(int atRow,
int atCol)
Checks if the cell at (atRow, atCol) position contains a label (leaving unchanged the counter) |
boolean |
eof()
Tests if reading head reached the end of file (the last element in sequence). |
boolean |
eol()
Tests if reading head reached the end of line. |
boolean |
existsSheetWithName(java.lang.String sheetName)
Tests if the 'sheetName' sheet is present in the current Excel document. |
xlrd.Sheet |
getCurrentSheet()
Returns the current sheet reference. |
double |
getDblValue()
Gets the next value in reading sequence and returns it as a double value. |
double |
getDblValue(int atRow,
int atCol)
Gets the value at (atRow, atCol) position and returns it as a double value. |
int |
getIntValue()
Gets the next value in reading sequence and returns it as an int value. |
int |
getIntValue(int atRow,
int atCol)
Gets the value at (atRow, atCol) position and returns it as an int value. |
java.lang.String |
getStrValue()
Gets the next value in reading sequence and returns it as a String value. |
java.lang.String |
getStrValue(int atRow,
int atCol)
Gets the value at (atRow, atCol) position and returns it as a String value. |
void |
selectSheet(java.lang.String sheetName)
Changes the current sheet to the 'sheetName'. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExcelReader(java.lang.String fileName)
public ExcelReader(java.lang.String fileName, boolean skipEmptyCells)
public ExcelReader(java.lang.String fileName, boolean skipEmptyCells, java.lang.String sheetName)
Method Detail |
public boolean existsSheetWithName(java.lang.String sheetName)
public void selectSheet(java.lang.String sheetName)
public xlrd.Sheet getCurrentSheet()
public java.lang.String getStrValue(int atRow, int atCol)
public int getIntValue(int atRow, int atCol)
public double getDblValue(int atRow, int atCol)
public boolean checkForLabelCell(int atRow, int atCol)
public java.lang.String getStrValue()
public int getIntValue()
public double getDblValue()
public boolean checkForLabelCell()
public boolean eof()
public boolean eol()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |