|
|||||||||
| 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. |
int |
contentID
Index Reference for content tag. |
boolean |
deepfs
File system indicator. |
int |
dirID
Index Reference for directory tag. |
static byte |
DOC
Node kind: Document. |
static byte |
ELEM
Node kind: Element. |
int |
fileID
Index Reference for file tag. |
MetaData |
meta
Meta data. |
int |
nameID
Index Reference for name tag. |
static byte |
PI
Node kind: Processing instruction. |
int |
size
Table size. |
int |
sizeID
Index Reference for size attribute. |
int |
suffixID
Index Reference for suffix attribute. |
Names |
tags
Tag index. |
static byte |
TEXT
Node kind: Text. |
int |
timeID
Index Reference for time attribute. |
| 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. |
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 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(Index.TYPE index)
Closes the specified index. |
abstract void |
delete(int pre)
Deletes a node and its descendants. |
abstract void |
flush()
Flushes the table data. |
abstract int[][] |
ftIDs(byte[] fulltext,
FTOption ftOption)
Returns the indexed id references for the specified fulltext token. |
abstract int |
id(int pre)
Returns a unique node id. |
int[] |
ids(Index.TYPE type,
byte[] token)
Returns the indexed id references for the specified token. |
abstract void |
info(PrintOutput out)
Returns info on the index structures. |
void |
initNames()
Dissolves the references to often used tag names and attributes. |
abstract void |
insert(int pre,
int par,
byte[] val,
byte kind)
Inserts a tag name, text node, comment or processing instruction. |
abstract void |
insert(int pre,
int par,
byte[] name,
byte[] val)
Inserts an attribute. |
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. |
boolean |
noLeaf(int id)
Returns if the specified tag is no leaf element. |
abstract int |
nrFTIDs(byte[] token)
Returns the number of indexed id references for the specified token. |
int |
nrIDs(Index.TYPE type,
byte[] token)
Returns the number of indexed id references for the specified token. |
int |
nrTags(int id)
Returns the number of occurrences of the specified tag. |
abstract void |
openIndex(Index.TYPE type,
Index ind)
Opens the specified index. |
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 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 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. |
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 ATTR
public Names atts
public static final byte COMM
public int contentID
public boolean deepfs
public int dirID
public static final byte DOC
public static final byte ELEM
public int fileID
public MetaData meta
public int nameID
public static final byte PI
public int size
public int sizeID
public int suffixID
public Names tags
public static final byte TEXT
public int timeID
| Constructor Detail |
|---|
public Data()
| Method Detail |
|---|
public final byte[] atom(int pre)
pre - pre value
public final double atomNum(int pre)
pre - pre value
public final byte[] attName(int pre)
pre - pre value
public final int attNameID(byte[] tok)
tok - token to be found
public abstract int attNameID(int pre)
pre - pre value
public abstract double attNum(int pre)
pre - pre value
public abstract int attSize(int pre,
int kind)
pre - pre valuekind - node kind
public abstract byte[] attValue(int pre)
pre - pre value
public final byte[] attValue(int att,
int pre)
att - attribute to be foundpre - pre value
public abstract void close()
throws java.io.IOException
java.io.IOException - in case the database could not be closed
public abstract void closeIndex(Index.TYPE index)
throws java.io.IOException
index - index to be closed
java.io.IOException - in case the index could not be closedpublic abstract void delete(int pre)
pre - pre value of the node to deletepublic abstract void flush()
public abstract int[][] ftIDs(byte[] fulltext,
FTOption ftOption)
fulltext - token to be looked upftOption - fulltext options
public abstract int id(int pre)
pre - pre value
public final int[] ids(Index.TYPE type,
byte[] token)
type - index to be looked uptoken - token to be found
public abstract void info(PrintOutput out)
throws java.io.IOException
out - output stream
java.io.IOException - I/O exceptionpublic final void initNames()
public abstract void insert(int pre,
int par,
byte[] val,
byte kind)
pre - pre valuepar - parent of nodeval - value to be insertedkind - node kind
public abstract void insert(int pre,
int par,
byte[] name,
byte[] val)
pre - pre valuepar - parent of nodename - attribute nameval - attribute value
public abstract void insert(int pre,
int par,
Data d)
pre - pre valuepar - parent of noded - data instance to copy frompublic abstract int kind(int pre)
pre - pre value
public final boolean noLeaf(int id)
id - id of the tag name
public abstract int nrFTIDs(byte[] token)
token - token to be looked up
public final int nrIDs(Index.TYPE type,
byte[] token)
type - index type.token - text to be found
public final int nrTags(int id)
id - id of the tag name
public abstract void openIndex(Index.TYPE type,
Index ind)
throws java.io.IOException
type - index to be openedind - index instance
java.io.IOException - in case the index could not be opened
public abstract int parent(int pre,
int kind)
pre - pre valuekind - node kind
public abstract int pre(int id)
id - unique node id
public abstract int size(int pre,
int kind)
pre - pre valuekind - node kind
public final byte[] tag(int pre)
pre - pre value
public final int tagID(byte[] tok)
tok - token to be found
public abstract int tagID(int pre)
pre - pre value
public abstract byte[] text(int pre)
pre - pre value
public abstract int textLen(int pre)
pre - pre value
public abstract double textNum(int pre)
pre - pre value
public abstract void update(int pre,
byte[] val)
pre - pre of the text node to changeval - value to be updated
public abstract void update(int pre,
byte[] name,
byte[] val)
pre - pre of node to insert aftername - attribute nameval - attribute value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||