|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.basex.data.Data
org.basex.data.DiskData
public final class DiskData
This class stores and organizes the node table and the index structures for textual content. All nodes in the table are accessed by their implicit pre value. Some restrictions on the data are currently given:
ELEMENTS: - Byte 0: Node kind (TAG) - Byte 1-2: Tag Reference - Byte 3: Number of attributes - Byte 4- 7: Number of descendants (size) - Byte 8-11: Relative parent reference - Byte 12-15: Unique Node ID TEXT NODES: - Byte 0: Node kind (TEXT/PI/COMM) - Byte 3- 7: Text reference - Byte 8-11: Relative parent reference - Byte 12-15: Unique Node ID ATTRIBUTE NODES: - Byte 0: Node kind (ATTR) - Byte 1-2: Attribute name reference - Byte 3- 7: Attribute value reference - Byte 11: Relative parent reference - Byte 12-15: Unique Node ID
| Field Summary |
|---|
| Fields inherited from class org.basex.data.Data |
|---|
ATTR, atts, COMM, contentID, deepfs, dirID, DOC, ELEM, fileID, meta, nameID, PI, size, sizeID, suffixID, tags, TEXT, timeID |
| Constructor Summary | |
|---|---|
DiskData(java.lang.String db)
Default Constructor. |
|
DiskData(java.lang.String db,
boolean index)
Constructor, specifying if indexes are to be opened as well. |
|
| Method Summary | |
|---|---|
int |
attNameID(int pre)
Returns an attribute name id (reference to the attribute name index). |
double |
attNum(int pre)
Returns an attribute value as double value. |
int |
attSize(int pre,
int kind)
Returns a number of attributes. |
byte[] |
attValue(int pre)
Returns an attribute value. |
void |
close()
Closes the current database. |
void |
closeIndex(Index.TYPE index)
Closes the specified index. |
void |
cls()
Closes the database without writing data back to disk. |
void |
delete(int pre)
Deletes a node and its descendants. |
void |
flush()
Flushes the table data. |
int[][] |
ftIDs(byte[] word,
FTOption ftO)
Returns the indexed id references for the specified fulltext token. |
int |
id(int pre)
Returns a unique node id. |
void |
info(PrintOutput out)
Returns info on the index structures. |
void |
insert(int pre,
int par,
byte[] val,
byte kind)
Inserts a tag name, text node, comment or processing instruction. |
void |
insert(int pre,
int par,
byte[] name,
byte[] val)
Inserts an attribute. |
void |
insert(int pre,
int par,
Data td)
Insert a data instance at the specified pre value. |
int |
kind(int pre)
Returns a node kind. |
int |
nrFTIDs(byte[] token)
Returns the number of indexed id references for the specified token. |
void |
openIndex(Index.TYPE type,
Index index)
Opens the specified index. |
int |
parent(int pre,
int kind)
Returns a pre value of the parent node. |
int |
pre(int id)
Returns a pre value. |
int |
size(int pre,
int kind)
Returns a size value (number of descendant table entries). |
int |
tagID(int pre)
Returns a tag id (reference to the tag index). |
byte[] |
text(int pre)
Returns a text. |
int |
textLen(int pre)
Returns a text length. |
double |
textNum(int pre)
Returns a text as double value. |
void |
update(int pre,
byte[] value)
Updates a tag name, text node, comment or processing instruction. |
void |
update(int pre,
byte[] name,
byte[] val)
Updates an attribute name and value. |
| Methods inherited from class org.basex.data.Data |
|---|
atom, atomNum, attName, attNameID, attValue, ids, initNames, noLeaf, nrIDs, nrTags, tag, tagID |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DiskData(java.lang.String db)
throws java.io.IOException
db - name of database
java.io.IOException - IO Exception
public DiskData(java.lang.String db,
boolean index)
throws java.io.IOException
db - name of databaseindex - open indexes
java.io.IOException - IO Exception| Method Detail |
|---|
public int attNameID(int pre)
Data
attNameID in class Datapre - pre value
public double attNum(int pre)
Data
attNum in class Datapre - pre value
public int attSize(int pre,
int kind)
Data
attSize in class Datapre - pre valuekind - node kind
public byte[] attValue(int pre)
Data
attValue in class Datapre - pre value
public void close()
throws java.io.IOException
Data
close in class Datajava.io.IOException - in case the database could not be closed
public void closeIndex(Index.TYPE index)
throws java.io.IOException
Data
closeIndex in class Dataindex - index to be closed
java.io.IOException - in case the index could not be closed
public void cls()
throws java.io.IOException
java.io.IOException - I/O exceptionpublic void delete(int pre)
Data
delete in class Datapre - pre value of the node to deletepublic void flush()
Data
flush in class Data
public int[][] ftIDs(byte[] word,
FTOption ftO)
Data
ftIDs in class Dataword - token to be looked upftO - fulltext options
public int id(int pre)
Data
id in class Datapre - pre value
public void info(PrintOutput out)
throws java.io.IOException
Data
info in class Dataout - output stream
java.io.IOException - I/O exception
public void insert(int pre,
int par,
byte[] val,
byte kind)
Data
insert in class Datapre - pre valuepar - parent of nodeval - value to be insertedkind - node kind
public void insert(int pre,
int par,
byte[] name,
byte[] val)
Data
insert in class Datapre - pre valuepar - parent of nodename - attribute nameval - attribute value
public void insert(int pre,
int par,
Data td)
Data
insert in class Datapre - pre valuepar - parent of nodetd - data instance to copy frompublic int kind(int pre)
Data
kind in class Datapre - pre value
public int nrFTIDs(byte[] token)
Data
nrFTIDs in class Datatoken - token to be looked up
public void openIndex(Index.TYPE type,
Index index)
Data
openIndex in class Datatype - index to be openedindex - index instance
public int parent(int pre,
int kind)
Data
parent in class Datapre - pre valuekind - node kind
public int pre(int id)
Data
pre in class Dataid - unique node id
public int size(int pre,
int kind)
Data
size in class Datapre - pre valuekind - node kind
public int tagID(int pre)
Data
tagID in class Datapre - pre value
public byte[] text(int pre)
Data
text in class Datapre - pre value
public int textLen(int pre)
Data
textLen in class Datapre - pre value
public double textNum(int pre)
Data
textNum in class Datapre - pre value
public void update(int pre,
byte[] value)
Data
update in class Datapre - pre of the text node to changevalue - value to be updated
public void update(int pre,
byte[] name,
byte[] val)
Data
update in class Datapre - pre of node to insert aftername - attribute nameval - attribute value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||