InternalWorkbook, HSSFSheet
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static class | HSSFWorkbook.
Totals the sizes of all sheet records and eventually serializes them |
| Modifier and Type | Field and Description |
|---|---|
| protected List | _sheets
this holds the HSSFSheet objects attached to this workbook |
| private final UDFFinder | _udfFinder
The locator of user-defined functions. |
| private static final Pattern | |
| private static final int | |
| private static final int | |
| private Map | fonts
this holds the HSSFFont objects attached to this workbook. |
| private HSSFDataFormat | formatter
Used to keep track of the data formatter so that all createDataFormatter calls return the same one for a given book. |
| public static final int | INITIAL_CAPACITY
used for compile-time performance/memory optimization. |
| private static final Logger | |
| private static int | |
| private static int | |
| private static final int | MAX_STYLES
The maximum number of cell styles in a .xls workbook. |
| private Row. | missingCellPolicy
The policy to apply in the event of missing or blank cells when fetching from a row. |
| private final ArrayList | names
this holds the HSSFName objects attached to this workbook |
| private boolean | preserveNodes
holds whether or not to preserve other nodes in the POIFS. |
| private InternalWorkbook | workbook
this is the reference to the low level Workbook object |
| Access | Constructor and Description |
|---|---|
| public | |
| private | |
| public | HSSFWorkbook(POIFSFileSystem fs)
Given a POI POIFSFileSystem object, read in its Workbook along with all related nodes, and populate the high and low level models. |
| public | HSSFWorkbook(POIFSFileSystem
the POI filesystem that contains the Workbook stream. fs, boolean whether to preserve other nodes, such as
macros. This takes more memory, so only say yes if you
need to. If set, will store all of the POIFSFileSystem
in memory preserveNodes)Given a POI POIFSFileSystem object, read in its Workbook and populate the high and low level models. |
| public | HSSFWorkbook(DirectoryNode
the POI filesystem directory to process from directory, POIFSFileSystem the POI filesystem that contains the Workbook stream. fs, boolean whether to preserve other nodes, such as
macros. This takes more memory, so only say yes if you
need to. If set, will store all of the POIFSFileSystem
in memory preserveNodes)given a POI POIFSFileSystem object, and a specific directory within it, read in its Workbook and populate the high and low level models. |
| public | HSSFWorkbook(DirectoryNode
the POI filesystem directory to process from directory, boolean whether to preserve other nodes, such as
macros. This takes more memory, so only say yes if you
need to. If set, will store all of the POIFSFileSystem
in memory preserveNodes)given a POI POIFSFileSystem object, and a specific directory within it, read in its Workbook and populate the high and low level models. |
| public | HSSFWorkbook(InputStream s)
Companion to HSSFWorkbook(POIFSFileSystem), this constructs the
POI filesystem around your |
| public | HSSFWorkbook(InputStream
the POI filesystem that contains the Workbook stream. s, boolean whether to preserve other nodes, such as
macros. This takes more memory, so only say yes if you
need to. preserveNodes)Companion to HSSFWorkbook(POIFSFileSystem), this constructs the
POI filesystem around your |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the index of the added ole objectan POIFS containing the embedded document, to be added poiData, String the label of the payload label, String the original filename fileName, String the command to open the payload command)Adds an OLE package manager object with the given POIFS to the sheet |
| public int | addOlePackage(byte[]
the payload oleData, String the label of the payload label, String the original filename fileName, String the command to open the payload command)Implements org. Adds an OLE package manager object with the given content to the sheet |
| public int | Returns: the index to this picture (1 based).The bytes of the picture pictureData, int The format of the picture. One of format)PICTURE_TYPE_*Implements org. Adds a picture to the workbook. |
| public void | addToolPack(UDFFinder
the toolpack to register toolpack)Implements org. Register a new toolpack in this workbook. |
| public boolean | Returns: true if the oldUrl was found and replaced with newUrl. Otherwise falseThe old URL to search for and which is to be replaced oldUrl, String The URL replacement newUrl)Changes an external referenced file to another file. |
| public HSSFSheet | Returns: HSSFSheet representing the cloned sheet.Implements org. create an HSSFSheet from an existing sheet in the HSSFWorkbook. |
| public void | close()
Overrides org. Implements org. Closes the underlying |
| private void | convertLabelRecords(List<Record>
a collection of sheet's records. records, int the offset to search at offset)This is basically a kludge to deal with the now obsolete Label records. |
| public static HSSFWorkbook | |
| pack-priv HSSFName | |
| public HSSFCellStyle | Returns: the new Cell Style objectImplements org. Create a new Cell style and add it to the workbook's style table. |
| public HSSFDataFormat | Returns: the HSSFDataFormat objectImplements org. Returns the instance of HSSFDataFormat for this workbook. |
| public HSSFEvaluationWorkbook | |
| public HSSFFont | Returns: new font objectImplements org. create a new Font and add it to the workbook's font table |
| public HSSFName | Returns: named range high levelImplements org. creates a new named range and add it to the model |
| public HSSFSheet | Returns: HSSFSheet representing the new sheet.Implements org. create an HSSFSheet for this HSSFWorkbook, adds it to the sheets and returns the high level representation. |
| public HSSFSheet | Returns: Sheet representing the new sheet.sheetname to set for the sheet. sheetname)Implements org. Create a new sheet for this Workbook and return the high level representation. |
| public void | |
| pack-priv void | |
| pack-priv int | |
| public HSSFFont | findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline)
Implements org. Finds a font that matches the one with the supplied attributes |
| public int | getActiveSheetIndex()
Implements org. gets the tab whose data is actually seen when the sheet is opened. |
| public List | Returns: the list of embedded objects (a list ofHSSFObjectData objects.)Gets all embedded OLE2 objects from the Workbook. |
| private void | getAllEmbeddedObjects(HSSFSheet
embedded object attached to sheet, List<HSSFObjectData> the list of embedded objects to populate. objects)Gets all embedded OLE2 objects from the Workbook. |
| private void | getAllEmbeddedObjects(HSSFShapeContainer
the parent. parent, List<HSSFObjectData> the list of embedded objects to populate. objects)Recursively iterates a shape container to get all embedded objects. |
| public List | getAllNames()
Implements org. Returns all defined names. |
| public List | Returns: the list of pictures (a list ofHSSFPictureData objects.)Implements org. Gets all pictures from the Workbook. |
| public boolean | Returns: the current setting for backups.determine whether the Excel GUI will backup the workbook when saving. |
| pack-priv HSSFName | |
| public byte[] | Returns: byte[] array containing the binary representation of this workbook and all contained sheets, rows, cells, etc.Method getBytes - get the bytes of just the HSSF portions of the XLS file. |
| public CellReferenceType | |
| public HSSFCellStyle | Returns: HSSFCellStyle object at the indexindex within the set of styles idx)Implements org. get the cell style object at the given index |
| public HSSFCreationHelper | getCreationHelper()
Implements org. Returns an object that handles instantiating concrete classes of the various instances one needs for HSSF and XSSF. |
| public HSSFPalette | |
| public EncryptionInfo | |
| public EncryptionMode | |
| public int | getFirstVisibleTab()
Implements org. sets the first tab that is displayed in the list of tabs in excel. |
| public HSSFFont | getFontAt(int
index number (0-based) idx)Implements org. Get the font at the given index number |
| public boolean | getForceFormulaRecalculation()
Implements org. Whether Excel will be asked to recalculate all formulas when the workbook is opened. |
| public InternalWorkbook | |
| public static int | |
| public static int | |
| public Row. | getMissingCellPolicy()
Implements org. Retrieves the current policy on what to do when getting missing or blank cells from a row. |
| public HSSFName | getName(String
the name of the defined name name)Implements org.
|
| pack-priv HSSFName | |
| pack-priv int | |
| pack-priv int | Returns: an index value >= 0 if the name was found; -1, if the name was not foundthe name whose index in the list of names of this workbook
should be looked up. name)As |
| public String | Returns: named range namethe named range index (0 based) index)gets the named range name |
| public NameRecord | |
| public List | getNames(String
the name of the defined name name)Implements org. Returns all defined names with the given name. |
| public int | getNumberOfFonts()
Implements org. Get the number of fonts in the font table |
| public int | getNumberOfFontsAsInt()
Implements org.
Deprecated
Get the number of fonts in the font table |
| public int | |
| public int | Returns: number of sheetsImplements org. get the number of spreadsheets in the workbook (this will be three after serialization) |
| public int | Returns: count of cell stylesImplements org. get the number of styles the workbook contains |
| pack-priv static Map | |
| public String | Returns: String Null if no print area has been definedZero-based sheet index (0 Represents the first sheet to keep consistent with java) sheetIndex)Implements org. Retrieves the reference for the printarea of the specified sheet, the sheet name is appended to the reference even if it was not specified. |
| public Collection | Returns: indices of selected sheetsGets the selected sheets (if more than one, Excel calls these a [Group]). |
| public HSSFSheet | Returns: HSSFSheet with the name provided ornull if it does not existof the sheet name)Implements org. Get sheet with the given name (case insensitive match) |
| public HSSFSheet | Returns: HSSFSheet at the provided indexof the sheet number (0-based physical & logical) index)Implements org. Get the HSSFSheet object at the given index. |
| public int | Returns: index of the sheet (0 based) or -1 if it was not found.the sheet name name)Implements org. Returns the index of the sheet by his name |
| public int | Returns: index of the sheet (0 based).-1 if not foundthe sheet to look up sheet)Implements org. Returns the index of the given sheet |
| public String | Returns: Sheet name for the specified indexsheet number (0 based) sheetIndex)Implements org. Get the sheet name |
| private HSSFSheet[] | |
| public SheetVisibility | getSheetVisibility(int
the index of the sheet sheetIx)Implements org. Get the visibility (visible, hidden, very hidden) of a sheet in this workbook |
| public SpreadsheetVersion | Returns: EXCEL97 SpreadsheetVersion enumImplements org. Returns the spreadsheet version (EXCEL97) of this workbook |
| pack-priv UDFFinder | Returns: the locator of user-defined functionsReturns the locator of user-defined functions. |
| private String | |
| public InternalWorkbook | |
| public static String | |
| pack-priv void | |
| public void | |
| public boolean | |
| public boolean | isSheetHidden(int
Number sheetIx)Implements org. Check whether a sheet is hidden. |
| public boolean | isSheetVeryHidden(int
sheet index to check sheetIx)Implements org. Check whether a sheet is very hidden. |
| public boolean | |
| public int | linkExternalWorkbook(String
The name the workbook will be referenced as in formulas name, Workbook The open workbook to fetch the link required information from workbook)Implements org. Adds the LinkTable records required to allow formulas referencing the specified external workbook to be added to this one. |
| pack-priv void | |
| public void | removeName(Name
the name to remove. name)Implements org. Remove a name. |
| public void | removePrintArea(int
Zero-based sheet index (0 = First Sheet) sheetIndex)Implements org. Delete the printarea for the sheet specified |
| public void | removeSheetAt(int
of the sheet (0-based) index)Implements org. Removes sheet at the given index. |
| pack-priv void | |
| private void | searchForPictures(List<EscherRecord>
the escher records. escherRecords, List<HSSFPictureData> the list to populate with the pictures. pictures)Performs a recursive search for pictures in the given list of escher records. |
| public void | setActiveSheet(int
index of the active sheet (0-based) index)Implements org. Convenience method to set the active sheet. |
| public void | setBackupFlag(boolean
true to indicate a backup will be performed. backupValue)determine whether the Excel GUI will backup the workbook when saving. |
| public void | setCellReferenceType(CellReferenceType
the type of cell references used cellReferenceType)Implements org. Configure workbook to a specific cell reference type, e.g. R1C1 cell references (as opposed to A1 cell references). |
| public void | setEncryptionMode(EncryptionMode
the encryption mode mode)Sets the encryption mode - if not set, defaults to |
| public void | setFirstVisibleTab(int
the sheet index of the tab that will become the first in the tab-bar index)Implements org. sets the first tab that is displayed in the list of tabs in excel. |
| public void | setForceFormulaRecalculation(boolean
true if the application will perform a full recalculation of
workbook values when the workbook is opened value)Implements org. Whether the application shall perform a full recalculation when the workbook is opened. |
| public void | setHidden(boolean
pass hiddenFlag)false to make the workbook visible in the GUIImplements org.
|
| public static void | |
| public static void | |
| public void | setMissingCellPolicy(Row.
Implements org. Sets the policy on what to do when getting missing or blank cells from a row. |
| public void | setPrintArea(int
Zero-based sheet index (0 Represents the first sheet to keep consistent with java) sheetIndex, String Valid name Reference for the Print Area reference)Implements org. Sets the printarea for the sheet provided i.e. Reference = $A$1:$B$2 |
| public void | setPrintArea(int
Zero-based sheet index (0 = First Sheet) sheetIndex, int Column to begin printarea startColumn, int Column to end the printarea endColumn, int Row to begin the printarea startRow, int Row to end the printarea endRow)Implements org. For the Convenience of Java Programmers maintaining pointers. |
| private void | |
| public void | setSelectedTab(int
the index of the sheet to select (0 based) index)Implements org. Selects a single sheet. |
| public void | setSelectedTabs(int[]
Array of sheets to select, the index is 0-based. indexes)Selects multiple sheets as a group. |
| public void | setSelectedTabs(Collection<Integer>
Collection of sheets to select, the index is 0-based. indexes)Selects multiple sheets as a group. |
| public void | setSheetHidden(int
the sheet index (0-based) sheetIx, boolean True to mark the sheet as hidden, false otherwise hidden)Implements org. Hide or unhide a sheet. |
| public void | setSheetName(int
number (0 based) sheetIx, String name)Implements org. Set the sheet name. |
| public void | setSheetOrder(String
the name of the sheet to reorder sheetname, int the position that we want to insert the sheet into (0 based) pos)Implements org. sets the order of appearance for a given sheet. |
| public void | setSheetVisibility(int
the sheet index (0-based) sheetIx, SheetVisibility the sheet visibility to set visibility)Implements org. Hide or unhide a sheet. |
| public Iterator | Returns: an iterator of the sheets.Implements org. Returns an iterator of the sheets in the workbook in sheet order. |
| public Spliterator | Returns: a spliterator of the sheets.Overrides default org. Returns a spliterator of the sheets in the workbook in sheet order. |
| public void | |
| private void | |
| private void | |
| private void | updateNamedRangesAfterSheetReorder(int
the original index of the re-ordered sheet oldIndex, int the new index of the re-ordered sheet newIndex)copy-pasted from XSSFWorkbook#updateNamedRangesAfterSheetReorder(int, int) update sheet-scoped named ranges in this workbook after changing the sheet order of a sheet at oldIndex to newIndex. |
| private void | |
| public void | write()
Implements abstract org. Write out this workbook to the currently open |
| public void | write(File
The new File you wish to write the XLS to newFile)Implements abstract org. Method write - write out this workbook to a new |
| public void | write(OutputStream
- the java OutputStream you wish to write the XLS to stream)Implements abstract org. Implements org. Method write - write out this workbook to an |
| private void | |
| public void | writeProtectWorkbook(String
to set password, String username)protect a workbook with a password (not encrypted, just sets writeprotect flags and the password. |