|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ihr.xbrl.tools.excel.SheetPoint
public class SheetPoint
This class represents a cell in an HSSFSheet. It is easier operating with SheetPoints than operating with cells using the raw POI api.
| Constructor Summary | |
|---|---|
SheetPoint(java.lang.String sheetPointer)
Creates a sheetPoint object from the format sheetName! |
|
SheetPoint(java.lang.String name,
org.apache.poi.ss.usermodel.Sheet sh,
int row,
short col)
Creates a sheetPoint object providing all parameters |
|
SheetPoint(java.lang.String name,
org.apache.poi.ss.usermodel.Sheet sh,
java.lang.String rowCol)
Creates a sheetPoint object providing all parameters |
|
SheetPoint(java.lang.String sheetPointer,
org.apache.poi.ss.usermodel.Workbook wb)
Creates a sheetPoint object from a sheetPointer string of the following form: sheetName! |
|
| Method Summary | |
|---|---|
SheetPoint |
clone()
|
SheetPoint |
down()
Moves this SheetPoint to point to the cell that is below this cell |
SheetPoint |
down(int n)
Moves this SheetPoint down n cells |
boolean |
equals(java.lang.Object obj)
|
org.apache.poi.ss.usermodel.Cell |
getCell()
Obtains the HSSFCell object corresponding to the cell name |
java.lang.String |
getCellName()
|
short |
getCol()
Access to the column |
org.apache.poi.ss.usermodel.RichTextString |
getContent()
Access to the value of the cell and returns an HSSFRichTextString |
boolean |
getContentAsBoolean()
Access to the value in the cell pointed to by this object the value is converted to a boolean depending on the content type of the cell. |
boolean |
getContentAsBoolean(boolean exceptionsIfBlank,
boolean exceptionsIfError)
Access to the value in the cell pointed to by this object the value is converted to a boolean depending on the content type of the cell. |
java.lang.Double |
getContentAsDouble()
Access to the value in the cell as a Double |
java.lang.String |
getContentAsString()
Access to the value in the cell pointed to by this object the value is converted to a string depending on the content type of the cell. |
java.lang.String |
getName()
Access to the sheet name |
org.apache.poi.ss.usermodel.Cell |
getOrCreateCell()
Obtains the HSSFCell object or creates a new cell if it is not found in the HSSFSheet |
int |
getRow()
Access to the row |
org.apache.poi.ss.usermodel.Sheet |
getSheet()
Access to the sheet for this SheetPoint |
org.apache.poi.ss.usermodel.CellStyle |
getStyle()
Access to the style defined in the cell |
int |
hashCode()
|
SheetPoint |
left()
Moves this SheetPoint to point to the cell that is on the left of this cell |
SheetPoint |
left(int n)
Moves this SheetPoint to the left n cells |
SheetPoint |
right()
Moves this SheetPoint to point to the cell that is on the right of this cell |
SheetPoint |
right(int n)
Moves this SheetPoint to the right n cells |
void |
setCol(short col)
Sets the column |
void |
setRow(int row)
Sets the row |
java.lang.String |
toString()
|
SheetPoint |
up()
Moves this SheetPoint to point to the cell that is above this cell |
SheetPoint |
up(int n)
Moves this SheetPoint up n cells |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SheetPoint(java.lang.String sheetPointer,
org.apache.poi.ss.usermodel.Workbook wb)
throws SheetPointAccessException,
InvalidSheetPointException
Creates a sheetPoint object from a sheetPointer string of the following form: sheetName!Xn or sheetName!name
sheetName is the name of the sheet. It MUST exist
X is the row name in letters. First row is A...
n is the column number. First column is 1
$ characters are ignored. Sheet1!$A$3 will be considered equivalent to Sheet1!A3
The alternative format is based on a cell name (Range name). Cell names must exist at the time this object is created.
wb is the HSSFWorkBook. if not indicated then the HSSFSheet of this object will be null and sheet name will be the empty string
sheetPointer - Stringwb - HSSFWorkbook where the sheetName exists.
SheetPointAccessException - if the sheet does not exist in the workbook
InvalidSheetPointException - if the sheetPointer string is not properly written
public SheetPoint(java.lang.String name,
org.apache.poi.ss.usermodel.Sheet sh,
int row,
short col)
name - String Sheet namesh - HSSFSheet objectrow - row number, first row is 0col - col number, first col is 0
public SheetPoint(java.lang.String sheetPointer)
throws InvalidSheetPointException
This constructor does not resolve cell names and only works when the workbook or Sheet object is not required by the application.
Use with care
sheetPointer - the sheet point
InvalidSheetPointException
public SheetPoint(java.lang.String name,
org.apache.poi.ss.usermodel.Sheet sh,
java.lang.String rowCol)
throws InvalidSheetPointException
name - String Sheet namesh - HSSFSheet objectrowCol - row name and column name in A1 format
InvalidSheetPointException| Method Detail |
|---|
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic SheetPoint clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getName()
public java.lang.String getContentAsString()
throws SheetPointAccessException
SheetPointAccessException - if there is no cell in the sheet
public boolean getContentAsBoolean()
throws SheetPointAccessException
SheetPointAccessException - if there is no cell in the sheet
public boolean getContentAsBoolean(boolean exceptionsIfBlank,
boolean exceptionsIfError)
throws SheetPointAccessException
exceptionsIfBlank - if this parameter is true, the function will raise an exception if the cell is blank rather than return false which is the defaultexceptionsIfError - if this parameter is true, the function will raise an exception if the cell is an error rather than return false which is the default
SheetPointAccessException - if there is no cell in the sheet
public java.lang.Double getContentAsDouble()
throws SheetPointAccessException
SheetPointAccessException - if there is no cell in the sheet
public org.apache.poi.ss.usermodel.RichTextString getContent()
throws SheetPointAccessException
SheetPointAccessException - if there is no cell in the sheet
public org.apache.poi.ss.usermodel.CellStyle getStyle()
throws SheetPointAccessException
SheetPointAccessException
public org.apache.poi.ss.usermodel.Cell getCell()
throws SheetPointAccessException
SheetPointAccessException - if the row or the column does not existspublic org.apache.poi.ss.usermodel.Cell getOrCreateCell()
public org.apache.poi.ss.usermodel.Sheet getSheet()
public int getRow()
public short getCol()
public java.lang.String getCellName()
public void setRow(int row)
row - int new valuepublic void setCol(short col)
col - short new valuepublic SheetPoint up()
public SheetPoint up(int n)
n -
public SheetPoint down()
public SheetPoint down(int n)
n -
public SheetPoint left()
public SheetPoint left(int n)
n -
public SheetPoint right()
public SheetPoint right(int n)
n -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||