Package org.basex.build
Class MemBuilder
java.lang.Object
org.basex.core.jobs.Job
org.basex.build.Builder
org.basex.build.MemBuilder
This class creates a database instance in main memory.
The storage layout is described in the
Data class.- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttr(int nameId, byte[] value, int dist, int uriId) Adds an attribute to the database.protected voidaddDoc(byte[] value) Adds a document node to the database.protected voidaddElem(int dist, int nameId, int asize, int uriId, boolean ne) Adds an element node to the database.protected voidaddText(byte[] value, int dist, byte kind) Adds a text node to the database.build()Builds the database and returns the resulting database instance.static MemDataBuilds a main memory database instance with the specified name.static MemDataBuilds a main memory database instance.static MemDataBuilds a main memory database instance.data()Returns the data reference.voidinit()Initializes the builder.protected voidsetSize(int pre, int size) Stores a size value to the specified table position.Methods inherited from class org.basex.build.Builder
binary, binaryDir, closeDoc, closeElem, comment, detailedInfo, emptyElem, openDoc, openElem, pi, progressInfo, shortInfo, text
-
Constructor Details
-
MemBuilder
Constructor.- Parameters:
name- name of databaseparse- parser
-
-
Method Details
-
build
Builds a main memory database instance.- Parameters:
input- input- Returns:
- data database instance
- Throws:
IOException- I/O exception
-
build
Builds a main memory database instance.- Parameters:
parser- parser- Returns:
- data database instance
- Throws:
IOException- I/O exception
-
build
Builds a main memory database instance with the specified name.- Parameters:
name- name of databaseparser- parser- Returns:
- data database instance
- Throws:
IOException- I/O exception
-
build
Description copied from class:BuilderBuilds the database and returns the resulting database instance.- Specified by:
buildin classBuilder- Returns:
- data database instance
- Throws:
IOException- I/O exception
-
init
public void init()Initializes the builder. -
data
Returns the data reference.- Returns:
- data reference
-
addDoc
protected void addDoc(byte[] value) Description copied from class:BuilderAdds a document node to the database. -
addElem
protected void addElem(int dist, int nameId, int asize, int uriId, boolean ne) Description copied from class:BuilderAdds 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. -
addAttr
protected void addAttr(int nameId, byte[] value, int dist, int uriId) Description copied from class:BuilderAdds an attribute to the database. -
addText
protected void addText(byte[] value, int dist, byte kind) Description copied from class:BuilderAdds a text node to the database. -
setSize
protected void setSize(int pre, int size) Description copied from class:BuilderStores a size value to the specified table position.
-