Class SmallDocumentBlockList
java.lang.Object
org.docx4j.org.apache.poi.poifs.storage.SmallDocumentBlockList
- All Implemented Interfaces:
BlockList
A list of SmallDocumentBlocks instances, and methods to manage the list
-
Constructor Summary
ConstructorsConstructorDescriptionSmallDocumentBlockList(List<SmallDocumentBlock> blocks) Constructor SmallDocumentBlockList -
Method Summary
Modifier and TypeMethodDescriptionintReturns the count of the number of blocksfetchBlocks(int startBlock, int headerPropertiesStartBlock) get the blocks making up a particular stream in the list.protected ListManagedBlockget(int index) Unit testing method.protected intReturns the number of remaining blocksremove(int index) remove and return the specified block from the listvoidset 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- Specified by:
removein interfaceBlockList- Parameters:
index- the index of the specified block- Returns:
- the specified block
- Throws:
IOException- if the index is out of range or has already been removed
-
fetchBlocks
public ListManagedBlock[] fetchBlocks(int startBlock, int headerPropertiesStartBlock) throws IOException get 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:
IOException- if blocks are missing
-
setBAT
set the associated BlockAllocationTable- Specified by:
setBATin interfaceBlockList- Parameters:
bat- the associated BlockAllocationTable- Throws:
IOException
-
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
-