|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.poi.hssf.usermodel.HSSFWorkbook
High level representation of a workbook. This is the first object most users will construct whether they are reading or writing a workbook. It is also the top level object for creating new sheets/etc.
Workbook
,
HSSFSheet
Field Summary | |
static int |
INITIAL_CAPACITY
used for compile-time performance/memory optimization. |
Constructor Summary | |
HSSFWorkbook()
Creates new HSSFWorkbook from scratch (start here!) |
|
HSSFWorkbook(java.io.InputStream s)
Companion to HSSFWorkbook(POIFSFileSystem), this constructs the POI filesystem around your inputstream. |
|
HSSFWorkbook(POIFSFileSystem fs)
given a POI POIFSFileSystem object, read in its Workbook and populate the high and low level models. |
Method Summary | |
int |
addSSTString(java.lang.String string)
|
HSSFCellStyle |
createCellStyle()
create a new Cell style and add it to the workbook's style table |
HSSFFont |
createFont()
create a new Font and add it to the workbook's font table |
HSSFSheet |
createSheet()
create an HSSFSheet for this HSSFWorkbook, adds it to the sheets and returns the high level representation. |
HSSFSheet |
createSheet(java.lang.String sheetname)
create an HSSFSheet for this HSSFWorkbook, adds it to the sheets and returns the high level representation. |
boolean |
getBackupFlag()
determine whether the Excel GUI will backup the workbook when saving. |
byte[] |
getBytes()
Method getBytes - get the bytes of just the HSSF portions of the XLS file. |
HSSFCellStyle |
getCellStyleAt(short idx)
get the cell style object at the given index |
HSSFFont |
getFontAt(short idx)
get the font at the given index number |
short |
getNumberOfFonts()
get the number of fonts in the font table |
int |
getNumberOfSheets()
get the number of spreadsheets in the workbook (this will be three after serialization) |
short |
getNumCellStyles()
get the number of styles the workbook contains |
HSSFSheet |
getSheet(java.lang.String name)
Get sheet with the given name |
HSSFSheet |
getSheetAt(int index)
Get the HSSFSheet object at the given index. |
int |
getSheetIndex(java.lang.String name)
get the sheet's index |
java.lang.String |
getSheetName(int sheet)
get the sheet name |
java.lang.String |
getSSTString(int index)
|
void |
removeSheetAt(int index)
removes sheet at the given index |
void |
setBackupFlag(boolean backupValue)
determine whether the Excel GUI will backup the workbook when saving. |
void |
setSheetName(int sheet,
java.lang.String name)
set the sheet name. |
void |
write(java.io.OutputStream stream)
Method write - write out this workbook to an Outputstream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int INITIAL_CAPACITY
Constructor Detail |
public HSSFWorkbook()
public HSSFWorkbook(POIFSFileSystem fs) throws java.io.IOException
fs
- the POI filesystem that contains the Workbook stream.java.io.IOException
- if the stream cannot be readPOIFSFileSystem
public HSSFWorkbook(java.io.InputStream s) throws java.io.IOException
s
- the POI filesystem that contains the Workbook stream.java.io.IOException
- if the stream cannot be readPOIFSFileSystem
,
HSSFWorkbook(POIFSFileSystem)
Method Detail |
public void setSheetName(int sheet, java.lang.String name)
sheet
- number (0 based)sheet
- namepublic java.lang.String getSheetName(int sheet)
sheet
- Numberpublic int getSheetIndex(java.lang.String name)
name
- sheet namepublic HSSFSheet createSheet()
public HSSFSheet createSheet(java.lang.String sheetname)
sheetname
- sheetname to set for the sheet.public int getNumberOfSheets()
public HSSFSheet getSheetAt(int index)
index
- of the sheet number (0-based physical & logical)public HSSFSheet getSheet(java.lang.String name)
name
- of the sheetpublic void removeSheetAt(int index)
index
- of the sheet (0-based)public void setBackupFlag(boolean backupValue)
backupValue
- true to indicate a backup will be performed.public boolean getBackupFlag()
public HSSFFont createFont()
public short getNumberOfFonts()
public HSSFFont getFontAt(short idx)
idx
- index numberpublic HSSFCellStyle createCellStyle()
public short getNumCellStyles()
public HSSFCellStyle getCellStyleAt(short idx)
idx
- index within the set of stylespublic void write(java.io.OutputStream stream) throws java.io.IOException
stream
- - the java OutputStream you wish to write the XLS tojava.io.IOException
- if anything can't be written.POIFSFileSystem
public byte[] getBytes()
Workbook
,
Sheet
public int addSSTString(java.lang.String string)
public java.lang.String getSSTString(int index)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |