|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.core.Proc
org.basex.build.Builder
org.basex.build.MemBuilder
public final class MemBuilder
This class creates a database instance in main memory.
The storage layout is described in the Data
class.
Field Summary |
---|
Fields inherited from class org.basex.core.Proc |
---|
listen, updating |
Constructor Summary | |
---|---|
MemBuilder(java.lang.String nm,
Parser parse)
Constructor. |
Method Summary | |
---|---|
protected void |
addAttr(int nm,
byte[] value,
int dist,
int uri)
Adds an attribute to the database. |
protected void |
addDoc(byte[] value)
Adds a document node to the database. |
protected void |
addElem(int dist,
int nm,
int asize,
int uri,
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. |
static MemData |
build(Parser parser)
Builds a main memory database instance. |
static MemData |
build(java.lang.String name,
Parser parser)
Builds a main memory database instance with the specified name. |
void |
close()
Closes open references. |
Data |
data()
Returns the data reference. |
void |
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 |
---|
closeDoc, closeElem, comment, det, emptyElem, encoding, openDoc, openElem, pi, prog, text, tit |
Methods inherited from class org.basex.core.Proc |
---|
abort, checkStop, databases, detail, listen, proc, progress, registered, registered, startTimeout, stop, stopTimeout, title |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemBuilder(java.lang.String nm, Parser parse)
nm
- name of databaseparse
- parserMethod Detail |
---|
public static MemData build(Parser parser) throws java.io.IOException
parser
- parser
java.io.IOException
- I/O exceptionpublic static MemData build(java.lang.String name, Parser parser) throws java.io.IOException
name
- name of databaseparser
- parser
java.io.IOException
- I/O exceptionpublic MemData build() throws java.io.IOException
Builder
build
in class Builder
java.io.IOException
- I/O exceptionpublic void init()
public Data data()
public void close() throws java.io.IOException
Builder
close
in class Builder
java.io.IOException
- I/O exceptionprotected void addDoc(byte[] value)
Builder
addDoc
in class Builder
value
- name of the documentprotected void addElem(int dist, int nm, int asize, int uri, boolean ne)
Builder
Builder.setSize(int, int)
must
be called to set the final size value.
addElem
in class Builder
dist
- distance to parentnm
- the tag name referenceasize
- number of attributesuri
- namespace uri referencene
- namespace flagprotected void addAttr(int nm, byte[] value, int dist, int uri)
Builder
addAttr
in class Builder
nm
- attribute namevalue
- attribute valuedist
- distance to parenturi
- namespace uri referenceprotected void addText(byte[] value, int dist, byte kind)
Builder
addText
in class Builder
value
- the token to be added (tag name or content)dist
- distance to parentkind
- the node kindprotected void setSize(int pre, int size)
Builder
setSize
in class Builder
pre
- pre referencesize
- value to be stored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |