Package org.basex.build
Class MemBuilder
- java.lang.Object
-
- org.basex.core.jobs.Job
-
- org.basex.build.Builder
-
- org.basex.build.MemBuilder
-
-
Constructor Summary
Constructors Constructor Description MemBuilder(String name, Parser parser)
Constructor.MemBuilder(Parser parser)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAttr(int nameId, byte[] value, int dist, int uriId)
Adds an attribute to the database.protected void
addDoc(byte[] value)
Adds a document node to the database.protected void
addElem(int dist, int nameId, int asize, int uriId, boolean ne)
Adds an element node to the database.protected void
addText(byte[] value, int dist, byte kind)
Adds a text node to the database.MemData
build()
Builds the database and returns the resulting database instance.static MemData
build(String name, Parser parser)
Builds a main memory database instance with the specified name.static MemData
build(Parser parser)
Builds a main memory database instance.static MemData
build(IO input)
Builds a main memory database instance.Data
data()
Returns the data reference.MemBuilder
init()
Initializes the builder.protected void
setSize(int pre, int size)
Stores a size value to the specified table position.-
Methods inherited from class org.basex.build.Builder
binariesDir, binary, closeDoc, closeElem, comment, detailedInfo, emptyElem, openDoc, openElem, pi, progressInfo, shortInfo, text
-
-
-
-
Method Detail
-
build
public static MemData build(IO input) throws IOException
Builds a main memory database instance.- Parameters:
input
- input- Returns:
- data database instance
- Throws:
IOException
- I/O exception
-
build
public static MemData build(Parser parser) throws IOException
Builds a main memory database instance.- Parameters:
parser
- parser- Returns:
- data database instance
- Throws:
IOException
- I/O exception
-
build
public static MemData build(String name, Parser parser) throws IOException
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
public MemData build() throws IOException
Description copied from class:Builder
Builds the database and returns the resulting database instance.- Specified by:
build
in classBuilder
- Returns:
- data database instance
- Throws:
IOException
- I/O exception
-
init
public MemBuilder init()
Initializes the builder.- Returns:
- self reference
-
data
public Data data()
Returns the data reference.- Returns:
- data reference
-
addDoc
protected void addDoc(byte[] value)
Description copied from class:Builder
Adds a document node to the database.
-
addElem
protected void addElem(int dist, int nameId, int asize, int uriId, boolean ne)
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.
-
addAttr
protected void addAttr(int nameId, byte[] value, int dist, int uriId)
Description copied from class:Builder
Adds an attribute to the database.
-
addText
protected void addText(byte[] value, int dist, byte kind)
Description copied from class:Builder
Adds a text node to the database.
-
-