Interface XBTEditableDocument

  • All Superinterfaces:
    XBTDocument

    @ParametersAreNonnullByDefault
    public interface XBTEditableDocument
    extends XBTDocument
    Basic interface for editable XBUP level 1 document.
    • Method Detail

      • setRootBlock

        void setRootBlock​(@Nullable
                          XBTBlock block)
        Sets root block of the document.
        Parameters:
        block - the block to use as root block for this document
      • setTailData

        void setTailData​(@Nullable
                         java.io.InputStream source)
                  throws java.io.IOException
        Sets tail data.
        Parameters:
        source - data stream
        Throws:
        java.io.IOException - if input/output error
      • clear

        void clear()
        Clears all data in this document.
      • findBlockByIndex

        @Nonnull
        java.util.Optional<XBTBlock> findBlockByIndex​(long index)
        Finds node using depth-first traversal index.
        Parameters:
        index - order of the block in document
        Returns:
        block if found else null
      • createNewBlock

        @Nonnull
        XBTBlock createNewBlock​(@Nullable
                                XBTBlock parent)
        Creates new instance of block as next child for given block.
        Parameters:
        parent - block which would be set as parent block, null for root node
        Returns:
        newly created instance of this document