Package org.basex.build
Class DiskBuilder
java.lang.Object
org.basex.core.jobs.Job
org.basex.build.Builder
org.basex.build.DiskBuilder
This class creates a database instance on disk.
The storage layout is described in the
Data class.- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDiskBuilder(String name, Parser parser, StaticOptions sopts, MainOptions opts) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttr(int nameId, byte[] value, int dist, int uriId) Adds an attribute to the database.protected voidaddDoc(byte[] value) Adds a document node to the database.protected voidaddElem(int dist, int nameId, int asize, int uriId, boolean ne) Adds an element node to the database.protected voidaddText(byte[] value, int dist, byte kind) Adds a text node to the database.build()Builds the database and returns the resulting database instance.protected voidsetSize(int pre, int size) Stores a size value to the specified table position.Methods inherited from class org.basex.build.Builder
binary, binaryDir, closeDoc, closeElem, comment, detailedInfo, emptyElem, openDoc, openElem, pi, progressInfo, shortInfo, text
-
Constructor Details
-
DiskBuilder
Constructor.- Parameters:
name- name of databaseparser- parsersopts- static optionsopts- main options
-
-
Method Details
-
build
Description copied from class:BuilderBuilds the database and returns the resulting database instance.- Specified by:
buildin classBuilder- Returns:
- data database instance
- Throws:
IOException- I/O exception
-
addDoc
Description copied from class:BuilderAdds a document node to the database.- Specified by:
addDocin classBuilder- Parameters:
value- name of the document- Throws:
IOException- I/O exception
-
addElem
Description copied from class:BuilderAdds 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.- Specified by:
addElemin classBuilder- Parameters:
dist- distance to parentnameId- id of element nameasize- number of attributesuriId- id of namespace urine- namespace flag (indicates if this element introduces new namespaces)- Throws:
IOException- I/O exception
-
addAttr
Description copied from class:BuilderAdds an attribute to the database.- Specified by:
addAttrin classBuilder- Parameters:
nameId- id of attribute namevalue- attribute valuedist- distance to parenturiId- id of namespace uri- Throws:
IOException- I/O exception
-
addText
Description copied from class:BuilderAdds a text node to the database.- Specified by:
addTextin classBuilder- Parameters:
value- the token to be addeddist- distance to parentkind- the node kind- Throws:
IOException- I/O exception
-
setSize
Description copied from class:BuilderStores a size value to the specified table position.- Specified by:
setSizein classBuilder- Parameters:
pre- pre referencesize- value to be stored- Throws:
IOException- I/O exception
-