|
||||||||||
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 final class MemData
This class stores and organizes the database table and the index structures
for textual content in a compressed memory structure. The storage equals the
disk storage in DiskData
.
Field Summary |
---|
Fields inherited from class org.basex.data.Data |
---|
ATTR, atts, COMM, DOC, ELEM, fs, meta, nameID, ns, PI, size, sizeID, skel, tags, TEXT |
Constructor Summary | |
---|---|
MemData(int cap,
Names tag,
Names att,
Namespaces n,
Skeleton s)
Constructor. |
Method Summary | |
---|---|
void |
addAtt(long t,
long n,
byte[] v,
long d)
Adds an attribute. |
void |
addDoc(byte[] t,
long s)
Adds an element. |
void |
addElem(long t,
long n,
long d,
long a,
long s,
boolean ne)
Adds an element. |
void |
addText(byte[] t,
long d,
long 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[] |
attToken(int id)
Returns the index value for the specified attribute value id. |
byte[] |
attValue(int pre)
Returns an attribute value. |
void |
close()
Closes the current database. |
void |
closeIndex(IndexToken.Type index)
Closes the specified index. |
void |
delete(int pre)
Deletes a node and its descendants. |
void |
flush()
Flushes the table 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)
Insert 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(IndexToken.Type type,
Index ind)
Assigns the specified index. |
void |
setSize(int pre,
long 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[] attName,
byte[] attValue)
Updates an attribute name and value. |
Methods inherited from class org.basex.data.Data |
---|
atom, atomNum, attName, attNameID, attValue, doc, ids, info, initNames, nrIDs, tag, tagID, update |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemData(int cap, Names tag, Names att, Namespaces n, Skeleton s)
cap
- initial array capacitytag
- tag indexatt
- attribute name indexn
- namespacess
- skeletonMethod Detail |
---|
public void flush()
Data
flush
in class Data
public void close()
Data
close
in class Data
public void closeIndex(IndexToken.Type index)
Data
closeIndex
in class Data
index
- index to be closedpublic void setIndex(IndexToken.Type type, Index ind)
Data
setIndex
in class Data
type
- index to be openedind
- index instancepublic int id(int pre)
Data
id
in class Data
pre
- pre value
public int pre(int id)
Data
pre
in class Data
id
- unique node id
public int kind(int pre)
Data
kind
in class Data
pre
- pre value
public int parent(int pre, int k)
Data
parent
in class Data
pre
- pre valuek
- node kind
public int attSize(int pre, int kind)
Data
attSize
in class Data
pre
- pre valuekind
- node kind
public int size(int pre, int k)
Data
size
in class Data
pre
- pre valuek
- node kind
public int tagID(int pre)
Data
tagID
in class Data
pre
- pre value
public int tagNS(int pre)
Data
tagNS
in class Data
pre
- pre value
public int[] ns(int pre)
Data
ns
in class Data
pre
- pre value
public int attNameID(int pre)
Data
attNameID
in class Data
pre
- pre value
public int attNS(int pre)
Data
attNS
in class Data
pre
- pre value
public byte[] text(int pre)
Data
text
in class Data
pre
- pre value
public double textNum(int pre)
Data
textNum
in class Data
pre
- pre value
public byte[] attValue(int pre)
Data
attValue
in class Data
pre
- pre value
public double attNum(int pre)
Data
attNum
in class Data
pre
- pre value
public int textLen(int pre)
Data
textLen
in class Data
pre
- pre value
public int attLen(int pre)
Data
attLen
in class Data
pre
- pre value
public byte[] attToken(int id)
id
- index id
public void addDoc(byte[] t, long s)
t
- document names
- node sizepublic void addElem(long t, long n, long d, long a, long s, boolean ne)
t
- tagn
- namespaced
- distancene
- element has namespacesa
- number of attributess
- node sizepublic void addAtt(long t, long n, byte[] v, long d)
t
- attribute namen
- namespacev
- attribute valued
- distancepublic void addText(byte[] t, long d, long k)
t
- text to be addedd
- distancek
- node kindpublic void setSize(int pre, long val)
pre
- pre referenceval
- value to be storedpublic void setAttValue(int pre, byte[] val)
pre
- pre referenceval
- value to be storedpublic void delete(int pre)
Data
delete
in class Data
pre
- pre value of the node to deletepublic void update(int pre, byte[] attName, byte[] attValue)
Data
update
in class Data
pre
- pre of node to insert afterattName
- attribute nameattValue
- attribute valuepublic void insert(int pre, int par, byte[] tag, int kind)
Data
insert
in class Data
pre
- pre valuepar
- parent of nodetag
- value to be insertedkind
- node kindpublic void insert(int pre, int par, byte[] name, byte[] v)
Data
insert
in class Data
pre
- pre valuepar
- parent of nodename
- attribute namev
- attribute valuepublic void insert(int pre, int par, Data d)
Data
insert
in class Data
pre
- pre valuepar
- parent of noded
- data instance to copy frompublic void update(int pre, byte[] text)
Data
update
in class Data
pre
- pre of the text node to changetext
- value to be updated
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |