|
||||||||||
| 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
public abstract class Builder
This class provides an interface for building database instances.
The specified Parser send events to this class whenever nodes
are to be added or closed. The builder implementation decides whether
the nodes are stored on disk or kept in memory.
| Field Summary | |
|---|---|
MetaData |
meta
Meta data on built database. |
Parser |
parser
Parser instance. |
| Method Summary | |
|---|---|
abstract void |
addAttr(int n,
int s,
byte[] v,
int d)
Adds an attribute to the database. |
abstract void |
addDoc(byte[] tok)
Adds a document node to the database. |
abstract void |
addElem(int tok,
int tns,
int dis,
int as,
boolean n)
Adds an element node to the database. |
abstract void |
addText(byte[] tok,
int dis,
byte kind)
Adds a text node to the database. |
Data |
build()
Builds the database by running the specified parser. |
Data |
build(java.lang.String db)
Builds the database by running the specified parser. |
abstract void |
close()
Closes open references. |
void |
comment(TokenBuilder com)
Stores a comment. |
java.lang.String |
det()
Returns short information on this process. |
void |
emptyElem(byte[] tag,
Atts att)
Stores an empty element. |
void |
encoding(java.lang.String enc)
Sets the document encoding. |
void |
endDoc()
Closes a document node. |
void |
endElem(byte[] tag)
Closes an element. |
abstract void |
init(java.lang.String db)
Initializes the database construction. |
void |
nodeAndText(byte[] tag,
Atts att,
byte[] txt)
Convenience method for adding an element and text node. |
void |
pi(TokenBuilder pi)
Stores a processing instruction. |
double |
prog()
Returns progress information. |
abstract void |
setAttValue(int pre,
byte[] val)
Stores an attribute value to the specified table position. |
abstract void |
setSize(int pre,
int val)
Stores a size value to the specified table position. |
void |
startDoc(byte[] doc)
Opens a document node. |
int |
startElem(byte[] tag,
Atts att)
Opens a new element node. |
void |
startNS(byte[] name,
byte[] val)
Adds a new namespace; called by the building instance. |
void |
text(TokenBuilder t,
boolean w)
Stores a text node. |
java.lang.String |
tit()
Returns short information on this process. |
| 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 |
| Field Detail |
|---|
public final Parser parser
public MetaData meta
| Method Detail |
|---|
public abstract void init(java.lang.String db)
throws java.io.IOException
db - name of database
java.io.IOException - I/O exception
public abstract void close()
throws java.io.IOException
java.io.IOException - I/O exception
public abstract void addDoc(byte[] tok)
throws java.io.IOException
tok - the token to be added (tag name or content)
java.io.IOException - I/O exception
public abstract void addElem(int tok,
int tns,
int dis,
int as,
boolean n)
throws java.io.IOException
setSize(int, int) has
to be called with the final size value.
tok - the tag name referencetns - the tag namespacedis - distance (relative parent reference)as - number of attributesn - element has namespaces
java.io.IOException - I/O exception
public abstract void addAttr(int n,
int s,
byte[] v,
int d)
throws java.io.IOException
n - attribute names - namespacev - attribute valued - distance (relative parent reference)
java.io.IOException - I/O exception
public abstract void addText(byte[] tok,
int dis,
byte kind)
throws java.io.IOException
tok - the token to be added (tag name or content)dis - distance (relative parent reference)kind - the node kind
java.io.IOException - I/O exception
public abstract void setSize(int pre,
int val)
throws java.io.IOException
pre - pre referenceval - value to be stored
java.io.IOException - I/O exception
public abstract void setAttValue(int pre,
byte[] val)
throws java.io.IOException
pre - pre referenceval - value to be stored
java.io.IOException - I/O exception
public final Data build()
throws java.io.IOException
java.io.IOException - I/O exception
public final Data build(java.lang.String db)
throws java.io.IOException
db - name of database
java.io.IOException - I/O exception
public final void startDoc(byte[] doc)
throws java.io.IOException
doc - document name
java.io.IOException - I/O exception
public final void endDoc()
throws java.io.IOException
java.io.IOException - I/O exception
public final void startNS(byte[] name,
byte[] val)
name - the attribute name to be processedval - attribute value
public final int startElem(byte[] tag,
Atts att)
throws java.io.IOException
tag - tag nameatt - attributes
java.io.IOException - I/O exception
public final void emptyElem(byte[] tag,
Atts att)
throws java.io.IOException
tag - tag nameatt - attributes
java.io.IOException - I/O exception
public final void endElem(byte[] tag)
throws java.io.IOException
tag - tag name
java.io.IOException - I/O exception
public final void text(TokenBuilder t,
boolean w)
throws java.io.IOException
t - text valuew - whitespace flag
java.io.IOException - I/O exception
public final void comment(TokenBuilder com)
throws java.io.IOException
com - comment text
java.io.IOException - I/O exception
public final void pi(TokenBuilder pi)
throws java.io.IOException
pi - processing instruction name and value
java.io.IOException - I/O exceptionpublic final void encoding(java.lang.String enc)
enc - encoding
public final void nodeAndText(byte[] tag,
Atts att,
byte[] txt)
throws java.io.IOException
tag - the tag to be processedatt - attributestxt - text node
java.io.IOException - I/O exceptionpublic final java.lang.String tit()
Progress
tit in class Progresspublic final java.lang.String det()
Progress
det in class Progresspublic final double prog()
Progress
prog in class Progress
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||