public class TempFileSharedStringsTable extends SharedStringsTableBase
A workbook may contain thousands of cells containing string (non-numeric) data. Furthermore this data is very likely to be repeated across many rows or columns. The goal of implementing a single string table that is shared across the workbook is to improve performance in opening and saving the file by only reading and writing the repetitive information once.
Consider for example a workbook summarizing information for cities within various countries. There may be a column for the name of the country, a column for the name of each city in that country, and a column containing the data for each city. In this case the country name is repetitive, being duplicated in many cells. In many cases the repetition is extensive, and a tremendous savings is realized by making use of a shared string table when saving the workbook. When displaying text in the spreadsheet, the cell table will just contain an index into the string table as the value of a cell, instead of the full string.
The shared string table contains all the necessary information for displaying the string: the text, formatting properties, and phonetic properties (for East Asian languages).
fullFormat, stmap, strings| Constructor and Description |
|---|
TempFileSharedStringsTable() |
TempFileSharedStringsTable(boolean encryptTempFiles) |
TempFileSharedStringsTable(boolean encryptTempFiles,
boolean fullFormat) |
TempFileSharedStringsTable(org.apache.poi.openxml4j.opc.OPCPackage pkg,
boolean encryptTempFiles) |
TempFileSharedStringsTable(org.apache.poi.openxml4j.opc.OPCPackage pkg,
boolean encryptTempFiles,
boolean fullFormat) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected org.slf4j.Logger |
getLogger() |
List<org.apache.poi.ss.usermodel.RichTextString> |
getSharedStringItems()
TempFileSharedStringsTable only supports streaming access of shared strings.
|
protected Iterator<Integer> |
keyIterator() |
addSharedStringItem, getCount, getItemAt, getString, getUniqueCount, readFrom, writeTo_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toStringpublic TempFileSharedStringsTable()
throws IOException
IOExceptionpublic TempFileSharedStringsTable(boolean encryptTempFiles)
throws IOException
IOExceptionpublic TempFileSharedStringsTable(boolean encryptTempFiles,
boolean fullFormat)
throws IOException
IOExceptionpublic TempFileSharedStringsTable(org.apache.poi.openxml4j.opc.OPCPackage pkg,
boolean encryptTempFiles)
throws IOException
IOExceptionpublic TempFileSharedStringsTable(org.apache.poi.openxml4j.opc.OPCPackage pkg,
boolean encryptTempFiles,
boolean fullFormat)
throws IOException
IOExceptionprotected org.slf4j.Logger getLogger()
getLogger in class SharedStringsTableBaseprotected Iterator<Integer> keyIterator()
keyIterator in class SharedStringsTableBasepublic List<org.apache.poi.ss.usermodel.RichTextString> getSharedStringItems()
getItemAt instead.getSharedStringItems in class org.apache.poi.xssf.model.SharedStringsTableUnsupportedOperationException - not supportedpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class org.apache.poi.xssf.model.SharedStringsTableIOException