|
||||||||||
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 table mapping is documented in Data
.
Field Summary |
---|
Fields inherited from class org.basex.data.Data |
---|
atnindex, ATTR, atvindex, cache, COMM, DOC, ELEM, ftxindex, meta, nspaces, paths, PI, pins, resources, tagindex, TEXT, txtindex |
Constructor Summary | |
---|---|
MemData(Data data)
Light-weight constructor, adopting data structures from the specified database. |
|
MemData(Names tag,
Names att,
PathSummary ps,
Namespaces ns,
Prop pr,
Index txt,
Index atv)
Constructor. |
|
MemData(PathSummary ps,
Namespaces ns,
Prop pr)
Constructor. |
|
MemData(Prop pr)
Constructor, creating a new, empty database. |
Method Summary | |
---|---|
void |
close()
Closes the database. |
void |
closeIndex(IndexType type)
Closes the specified index. |
protected void |
delete(int pre,
boolean text)
Deletes the specified text entry. |
void |
finishUpdate()
Finishes an update operation: removes the update file and the exclusive lock. |
protected long |
index(int pre,
int id,
byte[] txt,
int kind)
Indexes a text and returns the reference. |
protected void |
indexDelete(int pre,
int size)
Delete a node and its descendants from the corresponding indexes. |
void |
setIndex(IndexType type,
Index index)
Assigns the specified index. |
boolean |
startUpdate()
Starts an update operation: writes a file to disk to indicate that an update is going on, and exclusively locks the table. |
byte[] |
text(int pre,
boolean text)
Returns a text (text, comment, pi) or attribute value. |
double |
textDbl(int pre,
boolean text)
Returns a text (text, comment, pi) or attribute value as double value. |
long |
textItr(int pre,
boolean text)
Returns a text (text, comment, pi) or attribute value as integer value. |
int |
textLen(int pre,
boolean text)
Returns the byte length of a text (text, comment, pi). |
void |
updateText(int pre,
byte[] val,
int kind)
Updates the specified text or attribute value. |
Methods inherited from class org.basex.data.Data |
---|
atom, attr, attSize, attValue, count, delete, dist, dist, doc, elem, id, info, inMemory, insert, insert, insertAttr, iter, kind, name, name, ns, nsFlag, nsFlag, parent, pre, pre, replace, size, size, text, toString, update, update, uri |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MemData(PathSummary ps, Namespaces ns, Prop pr)
ps
- path summaryns
- namespacespr
- database propertiespublic MemData(Names tag, Names att, PathSummary ps, Namespaces ns, Prop pr, Index txt, Index atv)
tag
- tag indexatt
- attribute name indexps
- path summaryns
- namespacespr
- database propertiestxt
- text indexatv
- attribute value indexpublic MemData(Data data)
data
- data referencepublic MemData(Prop pr)
pr
- property referenceMethod Detail |
---|
public void close()
Data
close
in class Data
public void closeIndex(IndexType type)
Data
closeIndex
in class Data
type
- index to be closedpublic void setIndex(IndexType type, Index index)
Data
setIndex
in class Data
type
- index to be openedindex
- index instancepublic boolean startUpdate()
Data
startUpdate
in class Data
public void finishUpdate()
Data
finishUpdate
in class Data
public byte[] text(int pre, boolean text)
Data
text
in class Data
pre
- pre valuetext
- text/attribute flag
public long textItr(int pre, boolean text)
Data
textItr
in class Data
pre
- pre valuetext
- text/attribute flag
public double textDbl(int pre, boolean text)
Data
textDbl
in class Data
pre
- pre valuetext
- text/attribute flag
public int textLen(int pre, boolean text)
Data
textLen
in class Data
pre
- pre valuetext
- text/attribute flag
protected void delete(int pre, boolean text)
Data
delete
in class Data
pre
- pre valuetext
- text (text, comment or pi) or attribute flagpublic void updateText(int pre, byte[] val, int kind)
Data
updateText
in class Data
pre
- pre valueval
- contentkind
- node kindprotected long index(int pre, int id, byte[] txt, int kind)
Data
index
in class Data
pre
- pre valueid
- id valuetxt
- text to be indexedkind
- node kind
protected void indexDelete(int pre, int size)
Data
indexDelete
in class Data
pre
- pre value of the node to deletesize
- number of descendants
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |