Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.basex.build
Class DiskBuilder

    java.lang.Object
      org.basex.core.Progress
          org.basex.build.Builder
              org.basex.build.DiskBuilder

    public final class DiskBuilder

extends Builder

This class creates a disk based database instance. The disk layout is described in the `DiskData` class.

Author:
  Workgroup DBIS, University of Konstanz 2005-09, ISC License, Christian Gruen

Field Summary

Fields inherited from class org.basex.build.Builder
`meta, parser`

Constructor Summary
`DiskBuilder(Parser p)` Constructor.

Method Summary
`void` | `addAttr(int t, int s, byte[] txt, int dis)` Adds an attribute to the database.
`void` | `addDoc(byte[] txt)` Adds a document node to the database.
`void` | `addElem(int t, int s, int dis, int as, boolean n)` Adds an element node to the database.
`void` | `addText(byte[] txt, int dis, byte kind)` Adds a text node to the database.
`void` | `close()` Closes open references.
`void` | `init(java.lang.String db)` Initializes the database construction.
`void` | `setAttValue(int pre, byte[] val)` Stores an attribute value to the specified table position.
`void` | `setSize(int pre, int val)` Stores a size value to the specified table position.

Methods inherited from class org.basex.build.Builder
`build, build, comment, det, emptyElem, encoding, endDoc, endElem, nodeAndText, pi, prog, startDoc, startElem, startNS, text, tit`

Methods inherited from class org.basex.core.Progress
`checkStop, detail, progress, progress, stop, title`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DiskBuilder

    public DiskBuilder(Parser p)

  Constructor.

  Parameters:
    `p` - parser

Method Detail

### init

    public void init(java.lang.String db)
              throws java.io.IOException

  Description copied from class: `Builder`
  Initializes the database construction.

  Specified by:
    `init` in class `Builder`
  Parameters:
    `db` - name of database
  Throws:
    `java.io.IOException` - I/O exception

### close

    public void close()
               throws java.io.IOException

  Description copied from class: `Builder`
  Closes open references.

  Specified by:
    `close` in class `Builder`
  Throws:
    `java.io.IOException` - I/O exception

### addDoc

    public void addDoc(byte[] txt)
                throws java.io.IOException

  Description copied from class: `Builder`
  Adds a document node to the database.

  Specified by:
    `addDoc` in class `Builder`
  Parameters:
    `txt` - the token to be added (tag name or content)
  Throws:
    `java.io.IOException` - I/O exception

### addElem

    public void addElem(int t,
                        int s,
                        int dis,
                        int as,
                        boolean n)
                 throws java.io.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)` has to be called with the final size value.

  Specified by:
    `addElem` in class `Builder`
  Parameters:
    `t` - the tag name reference
    `s` - the tag namespace
    `dis` - distance (relative parent reference)
    `as` - number of attributes
    `n` - element has namespaces
  Throws:
    `java.io.IOException` - I/O exception

### addAttr

    public void addAttr(int t,
                        int s,
                        byte[] txt,
                        int dis)
                 throws java.io.IOException

  Description copied from class: `Builder`
  Adds an attribute to the database.

  Specified by:
    `addAttr` in class `Builder`
  Parameters:
    `t` - attribute name
    `s` - namespace
    `txt` - attribute value
    `dis` - distance (relative parent reference)
  Throws:
    `java.io.IOException` - I/O exception

### addText

    public void addText(byte[] txt,
                        int dis,
                        byte kind)
                 throws java.io.IOException

  Description copied from class: `Builder`
  Adds a text node to the database.

  Specified by:
    `addText` in class `Builder`
  Parameters:
    `txt` - the token to be added (tag name or content)
    `dis` - distance (relative parent reference)
    `kind` - the node kind
  Throws:
    `java.io.IOException` - I/O exception

### setSize

    public void setSize(int pre,
                        int val)
                 throws java.io.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
    `val` - value to be stored
  Throws:
    `java.io.IOException` - I/O exception

### setAttValue

    public void setAttValue(int pre,
                            byte[] val)
                     throws java.io.IOException

  Description copied from class: `Builder`
  Stores an attribute value to the specified table position.

  Specified by:
    `setAttValue` in class `Builder`
  Parameters:
    `pre` - pre reference
    `val` - value to be stored
  Throws:
    `java.io.IOException` - I/O exception

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD