Class SmallDocumentBlockList
java.lang.Object
org.docx4j.org.apache.poi.poifs.storage.SmallDocumentBlockList
- All Implemented Interfaces:
BlockList
public class SmallDocumentBlockList
extends java.lang.Object
A list of SmallDocumentBlocks instances, and methods to manage the list
-
Constructor Summary
Constructors Constructor Description SmallDocumentBlockList(java.util.List<SmallDocumentBlock> blocks)Constructor SmallDocumentBlockList -
Method Summary
Modifier and Type Method Description intblockCount()Returns the count of the number of blocksListManagedBlock[]fetchBlocks(int startBlock, int headerPropertiesStartBlock)get the blocks making up a particular stream in the list.protected ListManagedBlockget(int index)Unit testing method.protected intremainingBlocks()Returns the number of remaining blocksListManagedBlockremove(int index)remove and return the specified block from the listvoidsetBAT(BlockAllocationTableReader bat)set the associated BlockAllocationTableprotected voidsetBlocks(ListManagedBlock[] blocks)provide blocks to managevoidzap(int index)remove the specified block from the list
-
Constructor Details
-
SmallDocumentBlockList
Constructor SmallDocumentBlockList- Parameters:
blocks- a list of SmallDocumentBlock instances
-
-
Method Details
-
setBlocks
provide blocks to manage- Parameters:
blocks- blocks to be managed
-
zap
public void zap(int index)remove the specified block from the list -
get
Unit testing method. Gets, without sanity checks or removing. -
remove
remove and return the specified block from the list -
fetchBlocks
public ListManagedBlock[] fetchBlocks(int startBlock, int headerPropertiesStartBlock) throws java.io.IOExceptionget the blocks making up a particular stream in the list. The blocks are removed from the list.- Specified by:
fetchBlocksin interfaceBlockList- Parameters:
startBlock- the index of the first block in the streamheaderPropertiesStartBlock- the index of the first header block in the stream- Returns:
- the stream as an array of correctly ordered blocks
- Throws:
java.io.IOException- if blocks are missing
-
setBAT
set the associated BlockAllocationTable -
blockCount
public int blockCount()Returns the count of the number of blocks- Specified by:
blockCountin interfaceBlockList
-
remainingBlocks
protected int remainingBlocks()Returns the number of remaining blocks
-