org.basex.data
Class DiskData

java.lang.Object
  extended by org.basex.data.Data
      extended by org.basex.data.DiskData

public final class DiskData
extends Data

This class stores and organizes the database table and the index structures for textual content in a compressed disk structure. The table mapping is documented in Data.

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Christian Gruen, Tim Petrowsky

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
DiskData(MetaData md, Names nm, Names at, PathSummary ps, Namespaces n)
          Internal constructor, specifying all meta data.
DiskData(String db, Prop pr)
          Default constructor.
 
Method Summary
 void closeIndex(Data.Type type)
          Closes the specified index.
 void cls()
          Internal method to close the database.
 void flush()
          Flushes the table data.
 void init()
          Dissolves the references to often used tag names and attributes.
 void setIndex(Data.Type type, Index index)
          Assigns the specified index.
 byte[] text(int pre, boolean text)
          Returns a text (text, comment, pi) or attribute value.
 int textLen(int pre, boolean text)
          Returns a text (text, comment, pi) length.
 double textNum(int pre, boolean text)
          Returns a text (text, comment, pi) as double value.
 
Methods inherited from class org.basex.data.Data
atom, attr, attSize, buffer, close, delete, doc, doc, elem, id, ids, info, insert, insert, insertAttr, kind, name, name, nrIDs, ns, nsFlag, parent, pre, rename, replace, size, size, text, toString, toString, uri
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiskData

public DiskData(String db,
                Prop pr)
         throws IOException
Default constructor.

Parameters:
db - name of database
pr - database properties
Throws:
IOException - IO Exception

DiskData

public DiskData(MetaData md,
                Names nm,
                Names at,
                PathSummary ps,
                Namespaces n)
         throws IOException
Internal constructor, specifying all meta data.

Parameters:
md - meta data
nm - tags
at - attributes
ps - path summary
n - namespaces
Throws:
IOException - IO Exception
Method Detail

init

public void init()
          throws IOException
Description copied from class: Data
Dissolves the references to often used tag names and attributes.

Overrides:
init in class Data
Throws:
IOException - I/O exception

flush

public void flush()
Description copied from class: Data
Flushes the table data.

Specified by:
flush in class Data

cls

public void cls()
         throws IOException
Description copied from class: Data
Internal method to close the database.

Throws:
IOException - I/O exception

closeIndex

public void closeIndex(Data.Type type)
                throws IOException
Description copied from class: Data
Closes the specified index.

Specified by:
closeIndex in class Data
Parameters:
type - index to be closed
Throws:
IOException - I/O exception

setIndex

public void setIndex(Data.Type type,
                     Index index)
Description copied from class: Data
Assigns the specified index.

Specified by:
setIndex in class Data
Parameters:
type - index to be opened
index - index instance

text

public byte[] text(int pre,
                   boolean text)
Description copied from class: Data
Returns a text (text, comment, pi) or attribute value.

Specified by:
text in class Data
Parameters:
pre - pre value
text - text/attribute flag
Returns:
atomized value

textNum

public double textNum(int pre,
                      boolean text)
Description copied from class: Data
Returns a text (text, comment, pi) as double value.

Specified by:
textNum in class Data
Parameters:
pre - pre value
text - text/attribute flag
Returns:
numeric value

textLen

public int textLen(int pre,
                   boolean text)
Description copied from class: Data
Returns a text (text, comment, pi) length.

Specified by:
textLen in class Data
Parameters:
pre - pre value
text - text/attribute flag
Returns:
length