|
||||||||||
| 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:
COMMON ATTRIBUTES: - Byte 0: KIND: Node kind (0-2) ELEMENT NODES: - Byte 0: NSPC: Namespace (4-7), NS Definition flag (3) - Byte 1-2: NAME: Name - Byte 3: ATTS: Number of attributes - Byte 4- 7: DIST: Distance to parent node - Byte 8-11: SIZE: Number of descendants - Byte 12-15: UNID: Unique Node ID DOCUMENT NODES: - Byte 3- 7: TEXT: Text reference - Byte 8-11: SIZE: Number of descendants - Byte 12-15: UNID: Unique Node ID TEXT NODES: - Byte 3- 7: TEXT: Text reference - Byte 8-11: DIST: Distance to parent node - Byte 12-15: UNID: Unique Node ID ATTRIBUTE NODES: - Byte 0: NSPC: Namespace (4-7) - Byte 1-2: NAME: Name - Byte 3- 7: TEXT: Attribute value reference - Byte 11: DIST: Distance to parent node - Byte 12-15: UNID: Unique Node ID
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.basex.data.Data |
|---|
Data.Type |
| Field Summary | |
|---|---|
TableAccess |
table
Table access file. |
| Fields inherited from class org.basex.data.Data |
|---|
ATTR, atts, COMM, DOC, ELEM, fs, meta, nameID, ns, path, PI, sizeID, tags, TEXT |
| Constructor Summary | |
|---|---|
DiskData(MetaData md,
Names nm,
Names at,
PathSummary ps,
Namespaces n)
Internal constructor, specifying all meta data. |
|
DiskData(java.lang.String db,
Prop pr)
Default constructor. |
|
| Method Summary | |
|---|---|
int |
attLen(int pre)
Returns an attribute value length. |
int |
attNameID(int pre)
Returns an attribute name id (reference to the attribute name index). |
int |
attNS(int pre)
Returns an attribute namespace (reference to the attribute namespace). |
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 |
closeIndex(Data.Type type)
Closes the specified index. |
void |
cls()
Internal method to close the database. |
void |
delete(int pre)
Deletes a node and its descendants. |
void |
flush()
Flushes the table data. |
int |
getLock()
Returns the locking situation of the data. |
int |
id(int pre)
Returns a unique node id. |
void |
init()
Dissolves the references to often used tag names and attributes. |
void |
insert(int pre,
int par,
byte[] name,
byte[] val)
Inserts an attribute. |
void |
insert(int pre,
int par,
byte[] val,
int kind)
Inserts a tag name, text node, comment or processing instruction. |
void |
insert(int pre,
int par,
Data dt)
Inserts a data instance at the specified pre value. |
int |
kind(int pre)
Returns a node kind. |
int[] |
ns(int pre)
Returns namespace key and value ids. |
int |
parent(int pre,
int kind)
Returns a pre value of the parent node. |
int |
pre(int id)
Returns a pre value. |
void |
setIndex(Data.Type type,
Index index)
Assigns the specified index. |
void |
setLock(int l)
Locks and unlocks the data reference. |
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). |
int |
tagNS(int pre)
Returns a tag namespace (reference to the tag namespace). |
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[] val)
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, attName, attNameID, attValue, close, doc, ids, info, nrIDs, tag, tagID, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public TableAccess table
| Constructor Detail |
|---|
public DiskData(java.lang.String db,
Prop pr)
throws java.io.IOException
db - name of databasepr - database properties
java.io.IOException - IO Exception
public DiskData(MetaData md,
Names nm,
Names at,
PathSummary ps,
Namespaces n)
throws java.io.IOException
md - meta datanm - tagsat - attributesps - path summaryn - namespaces
java.io.IOException - IO Exception| Method Detail |
|---|
public void init()
throws java.io.IOException
Data
init in class Datajava.io.IOException - I/O exceptionpublic void flush()
Data
flush in class Data
public void cls()
throws java.io.IOException
Data
java.io.IOException - I/O exception
public void closeIndex(Data.Type type)
throws java.io.IOException
Data
closeIndex in class Datatype - index to be closed
java.io.IOException - I/O exception
public void setIndex(Data.Type type,
Index index)
Data
setIndex in class Datatype - index to be openedindex - index instancepublic int id(int pre)
Data
id in class Datapre - pre value
public int pre(int id)
Data
pre in class Dataid - unique node id
public int kind(int pre)
Data
kind in class Datapre - pre value
public int parent(int pre,
int kind)
Data
parent in class Datapre - pre valuekind - node kind
public int attSize(int pre,
int kind)
Data
attSize in class Datapre - pre valuekind - node kind
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 int tagNS(int pre)
Data
tagNS in class Datapre - pre value
public int[] ns(int pre)
Data
ns in class Datapre - pre value
public int attNameID(int pre)
Data
attNameID in class Datapre - pre value
public int attNS(int pre)
Data
attNS in class Datapre - pre value
public byte[] text(int pre)
Data
text in class Datapre - pre value
public byte[] attValue(int pre)
Data
attValue in class Datapre - pre value
public double textNum(int pre)
Data
textNum in class Datapre - pre value
public double attNum(int pre)
Data
attNum in class Datapre - pre value
public int textLen(int pre)
Data
textLen in class Datapre - pre value
public int attLen(int pre)
Data
attLen in class Datapre - pre value
public void update(int pre,
byte[] val)
Data
update in class Datapre - pre of the text node to changeval - 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 valuepublic void delete(int pre)
Data
delete in class Datapre - pre value of the node to delete
public void insert(int pre,
int par,
byte[] val,
int 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 dt)
Data
insert in class Datapre - value at which to insert new datapar - parent pre value of nodedt - data instance to copy frompublic int getLock()
Data
getLock in class Datapublic void setLock(int l)
Data
setLock in class Datal - int kind of lock
1 = read lock
2 = write lock
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||