Class XSSFReader.SheetIterator
- java.lang.Object
-
- org.apache.poi.xssf.eventusermodel.XSSFReader.SheetIterator
-
- All Implemented Interfaces:
Iterator<InputStream>
- Direct Known Subclasses:
XSSFBReader.SheetIterator
- Enclosing class:
- XSSFReader
public static class XSSFReader.SheetIterator extends Object implements Iterator<InputStream>
Iterator over sheet data.
-
-
Field Summary
Fields Modifier and Type Field Description protected Iterator<XSSFReader.XSSFSheetRef>sheetIteratorIterator over CTSheet objects, returns sheets inlogicalorder.protected Map<String,PackagePart>sheetMapMaps relId and the corresponding PackagePartprotected XSSFReader.XSSFSheetRefxssfSheetRefCurrent sheet reference
-
Constructor Summary
Constructors Modifier Constructor Description protectedSheetIterator(PackagePart wb)Construct a new SheetIterator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Iterator<XSSFReader.XSSFSheetRef>createSheetIteratorFromWB(PackagePart wb)List<XSSFShape>getShapes()Returns the shapes associated with this sheet, an empty list or null if there is an exceptionCommentsgetSheetComments()Returns the comments associated with this sheet, or null if there aren't anyStringgetSheetName()Returns name of the current sheetPackagePartgetSheetPart()protected Set<String>getSheetRelationships()Gets string representations of relationships that are sheet-like.booleanhasNext()Returnstrueif the iteration has more elements.InputStreamnext()Returns input stream of the next sheet in the iterationprotected CommentsparseComments(PackagePart commentsPart)voidremove()We're read only, so remove isn't supported-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
sheetMap
protected final Map<String,PackagePart> sheetMap
Maps relId and the corresponding PackagePart
-
xssfSheetRef
protected XSSFReader.XSSFSheetRef xssfSheetRef
Current sheet reference
-
sheetIterator
protected final Iterator<XSSFReader.XSSFSheetRef> sheetIterator
Iterator over CTSheet objects, returns sheets inlogicalorder. We can't rely on the Ooxml4J's relationship iterator because it returns objects in physical order, i.e. as they are stored in the underlying package
-
-
Constructor Detail
-
SheetIterator
protected SheetIterator(PackagePart wb) throws IOException
Construct a new SheetIterator- Parameters:
wb- package part holding workbook.xml- Throws:
IOException
-
-
Method Detail
-
createSheetIteratorFromWB
protected Iterator<XSSFReader.XSSFSheetRef> createSheetIteratorFromWB(PackagePart wb) throws IOException
- Throws:
IOException
-
getSheetRelationships
protected Set<String> getSheetRelationships()
Gets string representations of relationships that are sheet-like. Added to allow subclassing by XSSFBReader. This is used to decide what relationships to load into the sheetRefs- Returns:
- all relationships that are sheet-like
-
hasNext
public boolean hasNext()
Returnstrueif the iteration has more elements.- Specified by:
hasNextin interfaceIterator<InputStream>- Returns:
trueif the iterator has more elements.
-
next
public InputStream next()
Returns input stream of the next sheet in the iteration- Specified by:
nextin interfaceIterator<InputStream>- Returns:
- input stream of the next sheet in the iteration
-
getSheetName
public String getSheetName()
Returns name of the current sheet- Returns:
- name of the current sheet
-
getSheetComments
public Comments getSheetComments()
Returns the comments associated with this sheet, or null if there aren't any
-
parseComments
protected Comments parseComments(PackagePart commentsPart) throws IOException
- Throws:
IOException
-
getShapes
public List<XSSFShape> getShapes()
Returns the shapes associated with this sheet, an empty list or null if there is an exception
-
getSheetPart
public PackagePart getSheetPart()
-
remove
public void remove()
We're read only, so remove isn't supported- Specified by:
removein interfaceIterator<InputStream>
-
-