Class DiskBuilder


public final class DiskBuilder extends Builder
This class creates a database instance on disk. The storage layout is described in the Data class.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • DiskBuilder

      public DiskBuilder(String name, Parser parser, StaticOptions sopts, MainOptions opts)
      Constructor.
      Parameters:
      name - name of database
      parser - parser
      sopts - static options
      opts - main options
  • Method Details

    • build

      public DiskData build() throws IOException
      Description copied from class: Builder
      Builds the database and returns the resulting database instance.
      Specified by:
      build in class Builder
      Returns:
      data database instance
      Throws:
      IOException - I/O exception
    • addDoc

      protected void addDoc(byte[] value) throws IOException
      Description copied from class: Builder
      Adds a document node to the database.
      Specified by:
      addDoc in class Builder
      Parameters:
      value - name of the document
      Throws:
      IOException - I/O exception
    • addElem

      protected void addElem(int dist, int nameId, int asize, int uriId, boolean ne) throws IOException
      Description copied from class: Builder
      Adds an element node to the database. This method stores a preliminary size value; if this node has further descendants, Builder.setSize(int, int) must be called to set the final size value.
      Specified by:
      addElem in class Builder
      Parameters:
      dist - distance to parent
      nameId - id of element name
      asize - number of attributes
      uriId - id of namespace uri
      ne - namespace flag (indicates if this element introduces new namespaces)
      Throws:
      IOException - I/O exception
    • addAttr

      protected void addAttr(int nameId, byte[] value, int dist, int uriId) throws IOException
      Description copied from class: Builder
      Adds an attribute to the database.
      Specified by:
      addAttr in class Builder
      Parameters:
      nameId - id of attribute name
      value - attribute value
      dist - distance to parent
      uriId - id of namespace uri
      Throws:
      IOException - I/O exception
    • addText

      protected void addText(byte[] value, int dist, byte kind) throws IOException
      Description copied from class: Builder
      Adds a text node to the database.
      Specified by:
      addText in class Builder
      Parameters:
      value - the token to be added
      dist - distance to parent
      kind - the node kind
      Throws:
      IOException - I/O exception
    • setSize

      protected void setSize(int pre, int size) throws IOException
      Description copied from class: Builder
      Stores a size value to the specified table position.
      Specified by:
      setSize in class Builder
      Parameters:
      pre - pre reference
      size - value to be stored
      Throws:
      IOException - I/O exception