|
||||||||||
| 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 Builderdb - name of database
public MemData finish()
throws java.io.IOException
Builder
finish in class Builderjava.io.IOException - in case of parsing or writing problemspublic void close()
Builder
close in class Builderpublic void addDoc(byte[] tok)
Builder
addDoc in class Buildertok - 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
BuilderBuilder.setSize(int, int) has
to be called with the final size value.
addElem in class Buildertok - 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 problems
public void addAttr(int n,
int s,
byte[] v,
int d)
Builder
addAttr in class Buildern - attribute names - namespacev - attribute valued - distance (relative parent reference)
public void addText(byte[] tok,
int par,
byte kind)
Builder
addText in class Buildertok - the token to be added (tag name or content)par - distance (relative parent reference)kind - the node kind
public void setSize(int pre,
int val)
Builder
setSize in class Builderpre - pre referenceval - value to be stored
public void setAttValue(int pre,
byte[] val)
Builder
setAttValue in class Builderpre - pre referenceval - value to be stored
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||