|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.data.Data
public abstract class Data
This class provides access to the database. The storage representation depends on the underlying implementation. Note that the methods of this class are optimized for performance. They won't check if you ask for wrong data. If you request a text node, e.g., get sure your pre value actually points to a text node. The same applies to the update operations; if you write an attribute to an element node, your database will get messed up.
Field Summary | |
---|---|
static byte |
ATTR
Node kind: Attribute. |
Names |
atts
Attribute name index. |
static byte |
COMM
Node kind: Comment. |
static byte |
DOC
Node kind: Document. |
static byte |
ELEM
Node kind: Element. |
DataFS |
fs
File system indicator. |
MetaData |
meta
Meta data. |
int |
nameID
Index Reference for name tag. |
Namespaces |
ns
Namespace index. |
static byte |
PI
Node kind: Processing instruction. |
int |
size
Table size. |
int |
sizeID
Index References. |
Skeleton |
skel
Tree structure. |
Names |
tags
Tag index. |
static byte |
TEXT
Node kind: Text. |
Constructor Summary | |
---|---|
Data()
|
Method Summary | |
---|---|
byte[] |
atom(int pre)
Returns an atomized content for any node kind. |
double |
atomNum(int pre)
Returns a atomized numeric content for any node kind. |
abstract int |
attLen(int pre)
Returns an attribute value length. |
byte[] |
attName(int pre)
Returns an attribute name. |
int |
attNameID(byte[] tok)
Returns an id for the specified attribute name. |
abstract int |
attNameID(int pre)
Returns an attribute name id (reference to the attribute name index). |
abstract int |
attNS(int pre)
Returns an attribute namespace (reference to the attribute namespace). |
abstract double |
attNum(int pre)
Returns an attribute value as double value. |
abstract int |
attSize(int pre,
int kind)
Returns a number of attributes. |
abstract byte[] |
attValue(int pre)
Returns an attribute value. |
byte[] |
attValue(int att,
int pre)
Finds the specified attribute and returns its value. |
abstract void |
close()
Closes the current database. |
abstract void |
closeIndex(IndexToken.Type index)
Closes the specified index. |
abstract void |
delete(int pre)
Deletes a node and its descendants. |
int[] |
doc()
Returns the document nodes. |
abstract void |
flush()
Flushes the table data. |
abstract int |
id(int pre)
Returns a unique node id. |
IndexIterator |
ids(IndexToken token)
Returns the indexed id references for the specified token. |
byte[] |
info(IndexToken.Type type)
Returns info on the specified index structure. |
void |
initNames()
Dissolves the references to often used tag names and attributes. |
abstract void |
insert(int pre,
int par,
byte[] name,
byte[] val)
Inserts an attribute. |
abstract void |
insert(int pre,
int par,
byte[] val,
int kind)
Inserts a tag name, text node, comment or processing instruction. |
abstract void |
insert(int pre,
int par,
Data d)
Insert a data instance at the specified pre value. |
abstract int |
kind(int pre)
Returns a node kind. |
int |
nrIDs(IndexToken token)
Returns the number of indexed id references for the specified token. |
abstract int[] |
ns(int pre)
Returns namespace key and value ids. |
abstract int |
parent(int pre,
int kind)
Returns a pre value of the parent node. |
abstract int |
pre(int id)
Returns a pre value. |
abstract void |
setIndex(IndexToken.Type type,
Index ind)
Assigns the specified index. |
abstract int |
size(int pre,
int kind)
Returns a size value (number of descendant table entries). |
byte[] |
tag(int pre)
Returns a tag name. |
int |
tagID(byte[] tok)
Returns an id for the specified tag. |
abstract int |
tagID(int pre)
Returns a tag id (reference to the tag index). |
abstract int |
tagNS(int pre)
Returns a tag namespace (reference to the tag namespace). |
abstract byte[] |
text(int pre)
Returns a text. |
abstract int |
textLen(int pre)
Returns a text length. |
abstract double |
textNum(int pre)
Returns a text as double value. |
void |
update()
Notifies meta structures of an update. |
abstract void |
update(int pre,
byte[] val)
Updates a tag name, text node, comment or processing instruction. |
abstract void |
update(int pre,
byte[] name,
byte[] val)
Updates an attribute name and value. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte DOC
public static final byte ELEM
public static final byte TEXT
public static final byte ATTR
public static final byte COMM
public static final byte PI
public MetaData meta
public int size
public Names tags
public Names atts
public Namespaces ns
public Skeleton skel
public DataFS fs
public int nameID
public int sizeID
Constructor Detail |
---|
public Data()
Method Detail |
---|
public final void initNames()
public abstract void flush()
public abstract void close() throws java.io.IOException
java.io.IOException
- in case the database could not be closedpublic abstract void closeIndex(IndexToken.Type index) throws java.io.IOException
index
- index to be closed
java.io.IOException
- in case the index could not be closedpublic abstract void setIndex(IndexToken.Type type, Index ind)
type
- index to be openedind
- index instancepublic abstract int id(int pre)
pre
- pre value
public abstract int pre(int id)
id
- unique node id
public abstract int kind(int pre)
pre
- pre value
public abstract int parent(int pre, int kind)
pre
- pre valuekind
- node kind
public abstract int size(int pre, int kind)
pre
- pre valuekind
- node kind
public abstract int tagID(int pre)
pre
- pre value
public final int tagID(byte[] tok)
tok
- token to be found
public final byte[] tag(int pre)
pre
- pre value
public abstract int tagNS(int pre)
pre
- pre value
public abstract int[] ns(int pre)
pre
- pre value
public abstract byte[] text(int pre)
pre
- pre value
public abstract double textNum(int pre)
pre
- pre value
public abstract int textLen(int pre)
pre
- pre value
public final byte[] attName(int pre)
pre
- pre value
public abstract int attNameID(int pre)
pre
- pre value
public final int attNameID(byte[] tok)
tok
- token to be found
public abstract int attNS(int pre)
pre
- pre value
public abstract byte[] attValue(int pre)
pre
- pre value
public abstract int attLen(int pre)
pre
- pre value
public abstract double attNum(int pre)
pre
- pre value
public final byte[] attValue(int att, int pre)
att
- attribute to be foundpre
- pre value
public abstract int attSize(int pre, int kind)
pre
- pre valuekind
- node kind
public final IndexIterator ids(IndexToken token)
token
- index token reference
public final int nrIDs(IndexToken token)
token
- text to be found
public final byte[] info(IndexToken.Type type)
type
- index type
public final int[] doc()
public final byte[] atom(int pre)
pre
- pre value
public final double atomNum(int pre)
pre
- pre value
public abstract void update(int pre, byte[] val)
pre
- pre of the text node to changeval
- value to be updatedpublic abstract void update(int pre, byte[] name, byte[] val)
pre
- pre of node to insert aftername
- attribute nameval
- attribute valuepublic abstract void delete(int pre)
pre
- pre value of the node to deletepublic abstract void insert(int pre, int par, byte[] val, int kind)
pre
- pre valuepar
- parent of nodeval
- value to be insertedkind
- node kindpublic abstract void insert(int pre, int par, byte[] name, byte[] val)
pre
- pre valuepar
- parent of nodename
- attribute nameval
- attribute valuepublic abstract void insert(int pre, int par, Data d)
pre
- pre valuepar
- parent of noded
- data instance to copy frompublic final void update()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |