|
||||||||||
| 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.MemData
public class MemData
This class stores and organizes the database table and the index structures
for textual content in a compressed memory structure. The table mapping
is documented in DiskData.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.basex.data.Data |
|---|
Data.Type |
| Field Summary |
|---|
| Fields inherited from class org.basex.data.Data |
|---|
ATTR, atts, COMM, DOC, ELEM, fs, meta, nameID, ns, path, PI, sizeID, tags, TEXT |
| Constructor Summary | |
|---|---|
MemData(int cap,
Names tag,
Names att,
Namespaces n,
PathSummary s,
Prop pr)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addAtt(int t,
int n,
byte[] v,
int d)
Adds an attribute. |
void |
addDoc(byte[] t,
int s)
Adds an element. |
void |
addElem(int t,
int n,
int d,
int a,
int s,
boolean ne)
Adds an element. |
void |
addText(byte[] t,
int d,
int k)
Adds a text node. |
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 index)
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 |
insert(int pre,
int par,
byte[] name,
byte[] v)
Inserts an attribute. |
void |
insert(int pre,
int par,
byte[] tag,
int kind)
Inserts a tag name, text node, comment or processing instruction. |
void |
insert(int pre,
int par,
Data d)
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 k)
Returns a pre value of the parent node. |
int |
pre(int id)
Returns a pre value. |
void |
setAttValue(int pre,
byte[] val)
Stores an attribute value to the table. |
void |
setIndex(Data.Type type,
Index ind)
Assigns the specified index. |
void |
setLock(int l)
Locks and unlocks the data reference. |
void |
setSize(int pre,
int val)
Stores a size value to the table. |
int |
size(int pre,
int k)
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[] text)
Updates a tag name, text node, comment or processing instruction. |
void |
update(int pre,
byte[] name,
byte[] v)
Updates an attribute name and value. |
| Methods inherited from class org.basex.data.Data |
|---|
atom, attName, attNameID, attValue, close, doc, ids, info, init, nrIDs, tag, tagID, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MemData(int cap,
Names tag,
Names att,
Namespaces n,
PathSummary s,
Prop pr)
cap - initial array capacitytag - tag indexatt - attribute name indexn - namespacess - path summarypr - database properties| Method Detail |
|---|
public final void flush()
Data
flush in class Datapublic final void cls()
Data
public final void closeIndex(Data.Type index)
Data
closeIndex in class Dataindex - index to be closed
public final void setIndex(Data.Type type,
Index ind)
Data
setIndex in class Datatype - index to be openedind - index instancepublic final int id(int pre)
Data
id in class Datapre - pre value
public final int pre(int id)
Data
pre in class Dataid - unique node id
public final int kind(int pre)
Data
kind in class Datapre - pre value
public final int parent(int pre,
int k)
Data
parent in class Datapre - pre valuek - node kind
public final int attSize(int pre,
int kind)
Data
attSize in class Datapre - pre valuekind - node kind
public final int size(int pre,
int k)
Data
size in class Datapre - pre valuek - node kind
public final int tagID(int pre)
Data
tagID in class Datapre - pre value
public final int tagNS(int pre)
Data
tagNS in class Datapre - pre value
public final int[] ns(int pre)
Data
ns in class Datapre - pre value
public final int attNameID(int pre)
Data
attNameID in class Datapre - pre value
public final int attNS(int pre)
Data
attNS in class Datapre - pre value
public final byte[] text(int pre)
Data
text in class Datapre - pre value
public final double textNum(int pre)
Data
textNum in class Datapre - pre value
public final byte[] attValue(int pre)
Data
attValue in class Datapre - pre value
public final double attNum(int pre)
Data
attNum in class Datapre - pre value
public final int textLen(int pre)
Data
textLen in class Datapre - pre value
public final int attLen(int pre)
Data
attLen in class Datapre - pre value
public final void addDoc(byte[] t,
int s)
t - document names - node size (+ 1)
public final void addElem(int t,
int n,
int d,
int a,
int s,
boolean ne)
t - tagn - namespaced - distancea - number of attributes (+ 1)s - node size (+ 1)ne - element has namespaces
public final void addAtt(int t,
int n,
byte[] v,
int d)
t - attribute namen - namespacev - attribute valued - distance
public final void addText(byte[] t,
int d,
int k)
t - text to be addedd - distancek - node kind
public final void setSize(int pre,
int val)
pre - pre referenceval - value to be stored
public final void setAttValue(int pre,
byte[] val)
pre - pre referenceval - value to be storedpublic final void delete(int pre)
Data
delete in class Datapre - pre value of the node to delete
public final void update(int pre,
byte[] name,
byte[] v)
Data
update in class Datapre - pre of node to insert aftername - attribute namev - attribute value
public final void insert(int pre,
int par,
byte[] tag,
int kind)
Data
insert in class Datapre - pre valuepar - parent of nodetag - value to be insertedkind - node kind
public final void insert(int pre,
int par,
byte[] name,
byte[] v)
Data
insert in class Datapre - pre valuepar - parent of nodename - attribute namev - attribute value
public final void insert(int pre,
int par,
Data d)
Data
insert in class Datapre - value at which to insert new datapar - parent pre value of noded - data instance to copy from
public final void update(int pre,
byte[] text)
Data
update in class Datapre - pre of the text node to changetext - value to be updatedpublic final int getLock()
Data
getLock in class Datapublic final 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 | |||||||||