Class SmallDocumentBlockList

  • All Implemented Interfaces:
    BlockList

    public class SmallDocumentBlockList
    extends Object
    A list of SmallDocumentBlocks instances, and methods to manage the list
    Author:
    Marc Johnson (mjohnson at apache dot org)
    • Constructor Detail

      • SmallDocumentBlockList

        public SmallDocumentBlockList​(List blocks)
        Constructor SmallDocumentBlockList
        Parameters:
        blocks - a list of SmallDocumentBlock instances
    • Method Detail

      • setBlocks

        protected void setBlocks​(ListManagedBlock[] blocks)
        provide blocks to manage
        Parameters:
        blocks - blocks to be managed
      • zap

        public void zap​(int index)
        remove the specified block from the list
        Specified by:
        zap in interface BlockList
        Parameters:
        index - the index of the specified block; if the index is out of range, that's ok
      • remove

        public ListManagedBlock remove​(int index)
                                throws IOException
        remove and return the specified block from the list
        Specified by:
        remove in interface BlockList
        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)
                                       throws IOException
        get the blocks making up a particular stream in the list. The blocks are removed from the list.
        Specified by:
        fetchBlocks in interface BlockList
        Parameters:
        startBlock - the index of the first block in the stream
        Returns:
        the stream as an array of correctly ordered blocks
        Throws:
        IOException - if blocks are missing