|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.core.Progress
org.basex.build.Builder
org.basex.build.MemBuilder
public final class MemBuilder
This class creates a memory based database instance.
Field Summary |
---|
Fields inherited from class org.basex.build.Builder |
---|
elms, meta, size |
Constructor Summary | |
---|---|
MemBuilder()
|
Method Summary | |
---|---|
void |
addAttr(int n,
int s,
byte[] v,
int d)
Adds an attribute to the database. |
void |
addDoc(byte[] tok)
Adds a document node to the database. |
void |
addElem(int tok,
int s,
int dis,
int a,
boolean n)
Adds an element node to the database. |
void |
addText(byte[] tok,
int par,
byte kind)
Adds a text node to the database. |
void |
close()
Closes open references. |
MemData |
finish()
Finishes the build process and returns a database reference. |
MemBuilder |
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, 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 |
---|
public MemBuilder()
Method Detail |
---|
public MemBuilder init(java.lang.String db)
Builder
init
in class Builder
db
- name of database
public MemData finish() throws java.io.IOException
Builder
finish
in class Builder
java.io.IOException
- in case of parsing or writing problemspublic void close()
Builder
close
in class Builder
public void addDoc(byte[] tok)
Builder
addDoc
in class Builder
tok
- the token to be added (tag name or content)public void addElem(int tok, int s, int dis, int a, boolean n) throws java.io.IOException
Builder
Builder.setSize(int, int)
has
to be called with the final size value.
addElem
in class Builder
tok
- the tag name references
- the tag namespacedis
- distance (relative parent reference)a
- number of attributesn
- element has namespaces
java.io.IOException
- in case of parsing or writing problemspublic void addAttr(int n, int s, byte[] v, int d)
Builder
addAttr
in class Builder
n
- attribute names
- namespacev
- attribute valued
- distance (relative parent reference)public void addText(byte[] tok, int par, byte kind)
Builder
addText
in class Builder
tok
- the token to be added (tag name or content)par
- distance (relative parent reference)kind
- the node kindpublic void setSize(int pre, int val)
Builder
setSize
in class Builder
pre
- pre referenceval
- value to be storedpublic void setAttValue(int pre, byte[] val)
Builder
setAttValue
in class Builder
pre
- pre referenceval
- value to be stored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |